Welcome to this tutorial for running OpenSceneGraph on Linux (Debian based) machine. I’m currently using Linux Mint 15 but it would be quite easy to follow along on any other Debian based OS. Let’s get started shall we!
The OpenSceneGraph is an open source high performance 3D graphics toolkit. It is a real-time graphics middle-ware used by application developers in fields that range from visual simulation (flight, marine, vehicle, space simulator) to virtual and augmented reality, to medical and scientific visualisation, to education and games. Written entirely in Standard C++ and OpenGL it runs on all Windows platforms, OSX, GNU/Linux, IRIX, Solaris, HP-Ux, AIX and FreeBSD operating systems.
You can get more information at the official website: OpenSceneGraph
You can download the openscenegraph source from one the following:
Download the .zip file and extract its contents in OpenSceneGraph folder in your home.
Downloading the Dependencies
You need to download the necessary dependencies to be able to compile OpenSceneGraph.
- Run the following command to download and install the necessary dependencies.
apt-get build-dep openscenegraph
- Or you can download .7z file from this page. And merge the files from this to the OpenSceneGraph folder in your home, for example, copy files from bin folder from .7z file to the bin folder in OpenSceneGraph folder. Do this for all the folders in .7z file.
The 2nd method is recommended for building.
Make sure you have cmake tool installed on your system in order to compile OpenSceneGraph. If not, follow steps on their website.
Downloading the Data Resources
OpenSceneGraph standard dataset is required for use the with openscenegraph-examples. You can download it from this page.
Extract the contents of .zip file in the OpenSceneGraph-Data folder in your home.
Now it’s time to compile. Run these commands in your terminal:
sudo make install
Running the Examples
Now our OpenSceneGraph has been built/compiled, its time to check it by running examples. But before we do that we need to place the location where it was installed on the system paths environmental variables. Edit your .bashrc file, add following lines in it:
Replace myaccount with your useraccount name.
Now we need to build the examples. Use following commands for building:
After the examples has been built you can run them, still in OpenSceneGraph folder, use following command:
Press Escape key to move to the next example.
That’s it! Enjoy OSG!