Tag Archives: OSG

OSG Applications Compile and Execute


  • Use Visual Studio 2005 (install service pack 1)

    • Add New Project for “Win32 Console Application”
    • Click next on application wizard, and then check “empty project” in additional options

  • Add the following path to the Additional Include Directories (Project Properties -> Configuration Properties -> C/C++ ->General -> Additional Include Directories)

    • $(OSG_ROOT)\include

  • Similarly, set the linker directory to the following

    • $(OSG_ROOT)\lib

  • And add the libraries to the input option of the linker setting

    • Release Mode: osgViewer.lib osgDB.lib osgUtil.lib osg.lib OpenThreads.lib opengl32.lib glu32.lib
    • Debug Mode: osgViewerd.lib osgDBd.lib osgUtild.lib osgd.lib OpenThreadsd.lib opengl32.lib glu32.lib

  • Finally, run your OSG application

OSG Getting Stated


  1. Download OSG-2.5.2.zip from ftp://dis.dankook.ac.kr/OSG/OSG-2.5.2.zip
  2. Unzip it at C drive
  3. Set environment variables

    • Go to Control panel -> System icon -> Advanced tab -> Environment variables
    • Add “C:\OSG-2.5.2\bin;C:\OSG-2.5.2\bin\osgplugins-2.5.2;C:\OSG-2.5.2\3rdParty\bin” for System’s “Path” variable
    • Create a new variable called “OSG_FILE_PATH” and set the value “C:\OSG-2.5.2\OpenSceneGraph-Data” for the variable
    • Create a new variable called “OSG_NOTIFY_LEVEL” and set the value “DEBUG_INFO” for the debug notification
    • Create a new variable called “OSG_SCREEN” and set the value “0” to use only one main display monitor
    • Create a new variable called “OSG_ROOT” and the set the value “C:\OSG-2.4.0” for Visual Studio .Net 2005

  4. Open a command window and run “osgviewer cow.osg”