Projet C IG (1A)

IHM (2A)


VR/AR/Post-WIMP (3A)


Projet image (2A)


HCI (MoSIG 2)


Test Logiciel


Projects Docs

Using Open Scene Graph

Many examples use Open Scene Graph (OSG) as a 2D/3D graphical toolkit.

Installation

On linux distribution, OSG can be installed with a package manager (yul, apt-get, ...). But OSG version 3.4.0 or later is required, sometimes it is better to compile it:

 git clone --branch OpenSceneGraph-3.4.0 \
       https://github.com/openscenegraph/OpenSceneGraph.git
 cd OpenSceneGraph
 cmake .
 make
 sudo make install

This is a large library that takes time to compile. On multi-core machine, use "make -j 10 install" for example to parallelize the build on 10 threads.

On windows, generate a makefile for "NMake", and request a "Release" build (by default, it seems to be "Debug"):

 cmake -G "NMake Makefiles" -D CMAKE_BUILD_TYPE=Release .

Test

You can download OSG sample models, and view them with the osgviewer program that was built in the previous step:

 wget http://www.openscenegraph.org/downloads/stable_releases/
                  OpenSceneGraph-3.4.0/data/OpenSceneGraph-Data-3.4.0.zip
 unzip OpenSceneGraph-Data-3.4.0.zip
 ./bin/osgviewer OpenSceneGraph-Data/spaceship.osgt

Press the 'escape' key to exit, press the 's' key several time displays rendering statistics. Execute 'osgviewer' with no parameter to get a list of all possible parameters, such as displaying in a window, or in stereo.

Using OSG with the post-wimp examples

By default, the post-wimp examples will search for OSG in the stardard locations (i.e. "/usr/local/include", "/usr/local/lib64", ...).

If building the examples fails, you can define the OSG_ROOT environment variable to point to the directory that contains the OSG distribution. For example, if you installed OSG in "/home/toto/OSG3.4.0", which contains the "bin", "include", etc... directories, then define OSG_ROOT to "/home/toto/OSG3.4.0". An example on how to define environment variables is provided on another page.

Once a program using OSG has successfully compiled, it may fail to execute because the shared libraries are not found. Tell the system where to find the missing libraries.

Edit - History - Upload - Print - Recent Changes - Search
Page last modified on November 08, 2016, at 08:07 AM