Installing OpenSceneGraph 2.8.2 in Mac
I was surprised that the latest stable version of OpenSceneGraph (that is 2.8.3 at the time) didn’t come with a precompiled version for Mac.
After waisting too much time trying to compile OSG 2.8.3 using MacPorts and the source code via CMake and Xcode all of them unsuccessfully, I decided to use the previous version, which can be found precompiled in a nice package in the ARToolworks website (note it is compiled for 32 bits only).
When installing the package, what it calls Applications, refers to osgviewer, osgconv, osgversion and osgarchive, installed under /usr/local/bin.
Something you don’t need to install are the Bundles, because they are the same as Applications, just in a bundle.app way.
Once installed you’re done. You can now open a terminal and write osgversion.
If you are new to OSG, you might also be interested in the following.
You can find the examples under /Applications/OpenSceneGraph/Examples, and if you go there, you will se bundle applications instead of executable files, which I prefer in this case. To get a cleaner installation of these, I suggest to move the executables next to the plugins:
cd /Library/Application\ Support/OpenSceneGraph
sudo mkdir Examples
sudo cp /Applications/OpenSceneGraph/Examples/*.app/Contents/MacOS/* Examples
sudo rm -r /Applications/OpenSceneGraph
Now, for the final touch, download the OpenSceneGraph-Data, and copy it to /Library/Application Support/OpenSceneGraph/Data. And something you will like if you want to develop using OSG and try the example code are these few lines that you should add to your .bash_profile:
export OSG_FILE_PATH=/Library/Application\ Support/OpenSceneGraph/Data
export OSG_EXAMPLES_PATH=/Library/Application\ Support/OpenSceneGraph/Examples
export PATH=$OSG_EXAMPLES_PATH:$PATH
Now you can access all OSG examples, and having the environment variable OSG_FILE_PATH, OSG knows where to look for demo files and textures. For example, run: osgviewer cow.osg or the example osgplanets.
Have fun with OSG
Update: you can continue reading how to compile a simple OSG program in Mac.

Trackbacks & Pingbacks