Version 8 (modified by martin, 7 years ago)

--

Getting Started

Follows is a quick step by step guide to helping new OpenSceneGraph users get up to speed on how to use the software in their own application development work.

1. Downloading the OpenSceneGraph

You may download the OpenSceneGraph as a set of binaries or source code tarballs for the current release which can be found on the Downloads page, or use SVN or Developer Releases to check out the development version of the OpenSceneGraph to get latest additions, revisions and bug fixes. For beginners we'd recommend using the binaries or the source tarballs.

2. The SVN + Development releases of the OpenSceneGraph build requires CMake

Important! OpenSceneGraph source builds after version 1.2 require the use of CMake utility before you can build OpenSceneGraph, see CMake Guide

If you plan to compile the OpenSceneGraph you'll also need to download the dependencies which are listed in the Dependencies. You don't need all the dependencies for the plugins as this are all options libraries. For 1.9.x the dependencies have been simplified, but for 1.2 and before you will require OpenThreads and Producer.

When running the examples its is useful to install the Sample Dataset so that the examples have some data to load.

3. How to compile and Install the OpenSceneGraph-1.2 (note, no longer applies to 1.9.x dev series)

The two subsections below are a quick guide to how to compile the OpenSceneGraph, more detailed guides see Make and PlatformSpecifics guides are also available for VisualStudio, Cygwin, Mingw and OSX.

3.1 Compiling under Unix (GNU/Linux, OSX, FreeBSD, IRIX, Solaries) and Cygwin/Mingw

Under Unix you cd in the OpenSceneGraph/ directory and type:

make

Then wait for the software to build, then once its built install it by logging in as root:

su

The install by typing:

make install

You can also install into a non standard place, print out the make help for futher instructions:

make help

3.2 Compiling under Windows with Visual Studio

Open the OpenSceneGraph\VisualStudio?\VisualStudio.dsw workspace file into Visual Studio .NET and compile. It is possible to compile using Visual Studio 6.0 but this is not recommend due to large number of bugs in Visual Studio 6.0, see Support/PlatformSpecifics/VisualStudio for further details.

3.3 Compiling under Windows with Dev-C++

Import the .dsp files into dev-c++ and compile.

4. Running the example applications

To run the applications you need to set up the path to the applications, and its recommend that you add these environmental settings to you login setup such as autoexec.bat under Windows, or .tcshrc, or .bashrc under Unix. The binaries paths to set up are:

Unix, tcsh: setenv PATH {$PATH}:/usr/local/share/OpenSceneGraph/bin

Unix, bash: export PATH={$PATH}:/usr/local/share/OpenSceneGraph/bin
Windows : set PATH=Mypath;where\I\put\my\OpenSceneGraph\bin

Then set the OpenSceneGraph file path up, so that the examples can find the data:

Unix, tcsh: setenv OSG_FILE_PATH /home/myaccount/MyData/OpenSceneGraph-Data

Unix, bash: export OSG_FILE_PATH=/home/myaccount/MyData/OpenSceneGraph-Data
OSX, use the above expressions plus : setenv DYLD_BIND_AT_LAUNCH
Windows: set OSG_FILE_PATH=where\I\put\my\OpenSceneGraph-Data

Then to run a single application type in a console:

osgviewer cow.osg

Or to run all the examples one after the other:

cd OpenSceneGraph/ ./runexamples.bat

To advance to the next example simple press Escape, to print out help just press 'h'. If you want to have a quick look at what you should expect to see on screen browse through the Screenshots/OSGExamples. For further information of the examples also read through the Examples in the User Guides section.

5. Writing your first application

Take one of the existing examples such as osgviewer as a base and modify it.

6. Further resources

The key resources are collected together on the Support page, particular ones of interest are: