OpenSceneGraph 3.0 Cookbook First Look
I just received an electronic copy of Wang and Qian’s OpenSceneGraph 3.0 Cookbook. This is a followup to their OpenSceneGraph 3.0 Beginner’s Guide. The ebook was offered for free in exchange for publishing any type of review. I jumped at the chance because I found their first OSG book to be very helpful. Plus, I’m a cheapskate.
First, OpenSceneGraph (OSG) is exactly what it sounds like – an open source scene graph framework for OpenGL applications. It’s very powerful and, like many open source projects, under documented.
The book begins with a good explanation of the build process, then jumps right to the recipes. If you don’t already know OSG fundamentals (like nodes, cameras, shapes, etc…) you are going to be lost. All of that material is in the authors’ first OSG book and available in other places around the web.
Since I am still reading through the beginner’s guide, I didn’t plan on reading this book until I was finished. However, after skimming the table of contents, I couldn’t help diving in. Through some kind of great cosmic coincidence, Wang and Qian have included recipes for the exact functionality I want in our OSG-based application. Specifically, I have an immediate need for:
- Implementing a background image node
- Creating a polygon with borderlines
- Selecting and highlighting a model
- Showing the top, front, and side views of a model
- Manipulating the top, front, and side views
- Implementing transparency with multiple passes
- Customizing the state attribute
- Merging geometry data
- Configuring the database pager
- Using occlusion query to cull objects
- Taking a photo of the scene
The book is fairly easy to follow, although at times it’s clear that it wasn’t written by native English speakers. Usually that’s apparent from a strange phrase or description. The important part — the code — is well written and easy to understand.
I’m looking forward to adapting these recipes for my application. While a lot of the same information is available on the OSG mailing list, the book is going to save me a lot of time searching through posts and trying to follow instructions that were written years ago against a much older version of OSG.
A sample chapter is available here.