Shall We Learn

  • Increase font size
  • Default font size
  • Decrease font size

Build OpenSceneGraph on Windows

E-mail

What is OpenSceneGraph?

The OpenSceneGraph is an open source high performance 3D graphics toolkit, used by application developers in fields such as visual simulation, games, virtual reality, scientific visualization and modeling.

Image-0095

 

Step 0: Set up Build Environment on Windows

Install Visual Studio 2008 Professional Visual Studio Professional 2008 or Visual Studio Express 2008 (free). If you are using Visual Studio 2008 Express, dont forget to install Visual Studio 2008 Service Pack 1 SDK, which is necessary

Step1: Obtain OpenSceneGraph Code

Create a OpenGL directory in C:\Documents and Settings\<user>\My Documents\OpenGL

Download OpenSceneGraph source from OSG download page, unzip it to C:\Documents and Settings\<user>\My Documents\OpenGL

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0079.png

Step2: Obtain Third Party Library from OSG Site

Download third party library zipped file

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0081.pngC:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0080.png

Then unzip it to:

C:\Documents and Settings\<user>\My Documents\OpenGL¥<OpenSceneGraphSrc>¥third-party

In our case, its

C:\Documents and Settings\<user>\My Documents\OpenGL¥OpenSceneGraph-2.8.2-rc2¥third-party

Step3: Generate Solution File from Source Using CMake

Download CMake if not already installed. Start CMake GUI by double click CMakeSetup.exe, then select the OpenSceneGraph source directory ( in our case, C:\Documents and Settings\<user>\My Documents\OpenGL¥<OpenSceneGraphSrc> ) for both where is the source code and where to build the binaries.

Make sure you set the ACTUAL_3DPARTY_DIR correctly or else you will have linking errors. Set BUILD_MFC_EXAMPLE, BUILD_OSG_APPLICATIONS, and BUILD_OSG_EXAMPLES to ON. Also, delete string in SMAKE_DEBUG_POSTFIXThen Click Configure to update and display new values in red.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0091.png

Then press OK to generate selected build files and exit.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0086.png

When CMake is done, there should be an OpenSceneGraph.sln file in the OpenSceneGraph-2.8.2-rc2 directory.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0088.png

Double click OpenSceneGraph.sln to open the solution. If you would like to run the runexample.bat batch file, which runs all examples in batch mode, then set the build mode to RELEASE. To do so, right click on the OpenSceneGraph solution, select Properties.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0092.png

Set the Configuration from Active (Debug) to Release.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0093.pngC:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0094.png

After saving the new configuration , go to Solution->Rebuild to build everything, including OpenSceneGraph library, plugins, applications, and examples.

When learning anything technology new, I find it easier to look at examples. And OpenSceneGraph provides so many examples and they build without much tweaking. I am truly impressed.

Step 4: Set System Environment Variables

Before running the examples from OpenSceneGraph, add the following path to the Path system variable:

C:\Documents and Settings\u1\My Documents\OpenGL\OpenSceneGraph-2.8.2-rc2\3rdParty\bin

If you have linking errors when you run the examples, make sure your path is set correctly so that all relevant dlls can be found.

Step 5: Run several examples from OpenSceneGraph source code

Just double click the runexamples.bat and let yourself be amazed. This is a snapshot of a chess board.

C:\Documents and Settings\u1\My Documents\SnagIt Catalog\Image-0090.png

Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Thursday, 09 July 2009 00:18  

85px-Scratchcat.svg                       Java               python-logo