Menu:

OpenSceneGraph Quick Start Guide Official Web Page

About the Book

OpenSceneGraph Quick Start Guide is the first in a series of books from Skew Matrix Software to document OSG. It's a quick introduction to many commonly-used OSG features. Topics covered include source code organization, memory management, geometry and state control, lighting, texture mapping, rendering control, and animation techniques.

Buy the Book

OpenSceneGraph Quick Start Guide is available as a softbound 136 page book in both full-color and B&W editions. You may also download the book as a PDF file. To obtain a copy, visit Lulu.com. The PDF is free, but purchasing print copies helps fund future revisions to ensure that this book remains up-to-date.

Download the Examples

The example source code is available using anonymous svn from Google Code.

Errata

Corrections to the book are posted here. If you believe you've found a mistake, contact the author or post to osg-users. Thanks to the many reviewers of the pre-release edition for identifying several problems, which are fixed in the current edition.

Throughout. If you encounter issues accessing URLs with the openscenegraph.org domain name, try accessing the same URL using openscenegraph.com instead.

TOC. The TOC lists incorrect page numbers after section 2.2. This will be fixed in a future revision.

p9, File Search Path. "...use a color on other platforms," should read, "...use a colon on other platforms."

p9, Statistics Display. The third statistics display, which presents geometry information, was removed from OSG 2.0 and is no longer available. It is currently pending re-implementation.

pp 21, 25, and 27. The sidebar boxes summarizing each OSG library provide no information for Apple Mac OS X. Using Xcode frameworks, the header files are embedded in the framework. The library names end with ".framework". (For example, osg.framework, osgUtil.framework, etc.)

p22. Geode actually stores Drawable references in a std::vector< osg::ref_ptr< osg::Drawable > >. (The book incorrectly says "std::list< osg::Drawable >".)

pp35-37, Memory Management Examples. Several code snippets incorrectly omit the osg:: namespace qualifier. For example:

osg::ref_ptr<Geode> geode = new osg::Geode;
should read
osg::ref_ptr<osg::Geode> geode = new osg::Geode;

p37, Memory Management Examples. The example in the middle of the page that demonstrates incorrect usage by returning a dangling pointer, is incorrect. It should read as follows:

// DON’T do this. It stores the address as the return value on
// the call stack, but when the grp ref_ptr<> goes out of
// scope, the reference count goes to zero and the memory is
// deleted. The calling function is left with a dangling
// pointer.
osg::Group* createGroup()
{
    // Allocate a new Group node.
    osg::ref_ptr<osg::Group> grp = new osg::Group;

    // Return the new Group’s address.
    return grp.get();
}

p47, The Child Interface. The example contains incorrectly capitalized variable names. The code should read as follows:

osg::ref_ptr<osg::Group> group = new osg::Group;

osg::ref_ptr<osg::Geode> geode0 = new osg::Geode;
group->addChild( geode0.get() );

osg::ref_ptr<osg::Geode> geode1 = new osg::Geode;
group->addChild( geode1.get() );

p63, Figure 2.9. Ignore the extraneous text "TBD move" at the end of the figure caption.