2010-04-29

OpenSceneGraph Installation in Jaunty Jackalope (brief version)

aOpen synaptic package manager (see the System tab at the top, click it, go to Administration/Synaptic Package Manager). Search for "cmake". Check the box for cmake AND cmake-gui just below. Click "Apply" and install them.

Also in synaptic package manager, search for libtiff4-dev. "Apply" and install that. Close synaptic package manager.

Open a terminal and enter:

apt-get build-dep openscenegraph

Go to these sites and download the source files - OpenSceneGraph-2.8.2.zip.
AND OpenSceneGraph-Data-2.8.0.zip
http://www.openscenegraph.org/projects/osg/wiki/Downloads
http://www.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets

Unzip each of them into their own separate folders inside the /home/ultramanjones folder (insert your user name unless you are ultramanjones!)

(I renamed the OpenSceneGraph-2.8.2 to simply OpenSceneGraph, just to make things simpler)

In the terminal change directory to OpenSceneGraph
cd OpenSceneGraph
and then enter the following commands:
./configure
make
sudo make install
sudo ldconfig
Expect about 30 minutes to go by after typing make.

Open the CMake GUI. Go to Applications/Programming/CMake. Click Browse Source and open the OpenSceneGraph folder. Copy and paste the full path of the folder into the "where to build the binaries" field. Make sure the following are all checked:
BUILD_DOCUMENTATION
BUILD_OSG_APPLICATIONS
BUILD_OSG_EXAMPLES
BUILD_OSG_PACKAGES
BUILD_OSG_WRAPPERS

OSG_MAINTAINER
OSG_GLU_TESS_CALLBACK_TRIPLEDOT

Click the configure button. (this part is incomplete) There will be lots of red stuff to fix. This part is more complicated. You'll need to go into the synaptic package manager and install all the necessary files, dev files etc. for SDL and WxWidgets. Check if all the right stuff is installed by clicking configure again. The more correct things you add the less red lines there will be when you click configure. When all of the red is gone click the "generate" button.

Go back to the terminal and type "make" inside the OpenSceneGraph folder.

(OPTIONAL technique using ccmake without CMake GUI:
ccmake .
make
sudo make install

sudo ldconfig

The ccmake . command will open up an interface with bright yellow hilights. You can navigate through it using the arrow keys and the "page up"/"page down" keys. Make sure that application and examples are set to "on".

Type "c" on your keyboard to configure. You may want to hit it twice, just for good measure. Then type "g" to ready the build and exit. Move on to the next command above. Expect about 15 minutes to go by after typing make.)

Go to the /etc folder. Just click on Places, Computer and then filesystem to find it. Find a file named ld.so.conf and add this line to it:

/usr/local/lib
This will let OSG know where the libraries reside.

Then go back to the terminal and enter the following:
export PATH={$PATH}:/usr/local/share/OpenSceneGraph/bin

export OSG_FILE_PATH=/home/myaccount/MyData/OpenSceneGraph-Data

osgviewer cow.osg

You now should be looking at a shiny metallic cow! Move her around with the mouse. Woo hoo! You did it!



If it's still not working. Find this file CmakeCache.txt inside the OpenSceneGraph folder and find this line: BUILD_OSG_EXAMPLES:BOOL=ON. If it reads "OFF" instead of "ON" then change it and save the file.

For further reference see the links in the post just before this one.
Now direct your browser to http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials download the tutorials there and get your learn on.

NOTE: you will need to change a line or to in the makefiles that are included with the source code that is included with the tutorials. For instance, in the makefile for the 2nd tutorial line 6:
INCOSG = -I/home/franclin/OpenSceneGraph/include
Change "franclin" to the name of your user folder (ultramanjones for instance).

Also, Nate recommends that you add these three lines to the bottom of the makefile. This will clean up the data after you run the graphics applications:
clean:
rm -f $(EXE) *.o
rm -f *~

Make sure to put a tab before the 2nd and 3rd lines or you'll get a "missing separator" error.

No comments:

Post a Comment

Let me know what you think!