Free Sample
+ Collection

OpenSceneGraph 3 Cookbook

Rui Wang, Xuelei Qian

Over 80 recipes to show advanced 3D programming techniques with the OpenSceneGraph API book and ebook
RRP $29.99
RRP $49.99
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849516884
Paperback426 pages

About This Book

  • Introduce the latest OpenSceneGraph features to create stunning graphics, as well as integration with other famous libraries
  • Produce high-quality programs with short and familiar code
  • Enriched with a lot of code and the necessary screenshots


Who This Book Is For

You should be familiar with the basic concepts of the OpenSceneGraph API and should be able to write simple programs. Some OpenGL and math knowledge will help a lot, too.

Table of Contents

Chapter 1: Customizing OpenSceneGraph
Checking out the latest version of OSG
Configuring CMake options
Building common plugins
Compiling and packaging OSG on different platforms
Compiling and using OSG on mobile devices
Compiling and using dynamic and static libraries
Generating the API documentation
Creating your own project using CMake
Chapter 2: Designing the Scene Graph
Using smart and observer pointers
Sharing and cloning objects
Computing the world bounding box of any node
Creating a running car
Mirroring the scene graph
Designing a breadth-first node visitor
Implementing a background image node
Making your node always face the screen
Using draw callbacks to execute NVIDIA Cg functions
Implementing a compass node
Chapter 3: Editing Geometry Models
Creating a polygon with borderlines
Extruding a 2D shape to 3D
Drawing a NURBS surface
Drawing a dynamic clock on the screen
Drawing a ribbon following a model
Selecting and highlighting a model
Selecting a triangle face of the model
Selecting a point on the model
Using vertex-displacement mapping in shaders
Using the draw instanced extension
Chapter 4: Manipulating the View
Setting up views on multiple screens
Using slave cameras to simulate a power-wall
Using depth partition to display huge scenes
Implementing the radar map
Showing the top, front, and side views of a model
Manipulating the top, front, and side views
Following a moving model
Using manipulators to follow models
Designing a 2D camera manipulator
Manipulating the view with joysticks
Chapter 5: Animating Everything
Opening and closing doors
Playing a movie in the 3D world
Designing scrolling text
Implementing morph geometry
Fading in and out
Animating a flight on fire
Dynamically lighting within shaders
Creating a simple Galaxian game
Building a skeleton system
Skinning a customized mesh
Letting the physics engine be
Chapter 6: Designing Creative Effects
Using the bump mapping technique
Simulating the view-dependent shadow
Implementing transparency with multiple passes
Reading and displaying the depth buffer
Implementing the night vision effect
Implementing the depth-of-field effect
Designing a skybox with the cube map
Creating a simple water effect
Creating a piece of cloud
Customizing the state attribute
Chapter 7: Visualizing the World
Preparing the VirtualPlanetBuilder (VPB) tool
Generating a small terrain database
Generating terrain database on the earth
Working with multiple imagery and elevation data
Patching an existing terrain database with newer data
Building NVTT support for device-independent generation
Using SSH to implement cluster generation
Loading and rendering terrain from the Internet
Chapter 8: Managing Massive Amounts of Data
Merging geometry data
Compressing texture
Sharing scene objects
Configuring the database pager
Designing a simple culling strategy
Using occlusion query to cull objects
Managing scene objects with an octree algorithm
Rendering point cloud data with draw instancing
Speeding up the scene intersections
Chapter 9: Integrating with GUI
Integrating OSG with Qt
Starting rendering loops in separate threads
Embedding Qt widgets into the scene
Embedding CEGUI elements into the scene
Using the osgWidget library
Using OSG components in GLUT
Running OSG examples on Android
Embedding OSG into web browsers
Designing the command buffer mechanism

What You Will Learn

  • Configure and use OpenSceneGraph under different platforms, even mobile devices
  • Organize the scene graph and customize nodes in a more effective way
  • Create and edit geometries in an interacting form
  • Manipulate the camera to view the scene freely and easily
  • Animate rigid objects, vertices, textures, and characters in the scene
  • Create realistic effects with traditional and modern techniques
  • Integrate OpenSceneGraph with different libraries and windowing systems
  • Generate and manage massive data all over the earth


In Detail

OpenSceneGraph is an open source 3D graphics application programming interface, used by application developers in fields such as visual simulation, computer games, virtual reality, scientific visualization, and modeling. Familiar with its concepts and APIs, and need to improve your knowledge? This book is here to help. With exactly 100 recipes, it will enrich your experience and take you to the next level.

OpenSceneGraph 3 Cookbook will escort you into the world of real-time 3D development with OpenSceneGraph, the world famous 3D graphics engine. The book assumes that you are already familiar with some basic concepts, and provides 100 vivid recipes to demonstrate how to utilize the API flexibly and how to implement some practical aspects.

The book is divided into 10 chapters, each of which focuses on one topic. Readers may start from any topic they are interested in.

The book includes customizing OpenSceneGraph, designing scene graph, geometry, scene navigation, animations, effects using fixed pipeline and shaders, managing mass data, and miscellaneous discussions. Every recipe will prove to be useful in a practical way or in research.

OpenSceneGraph 3 Cookbook gives you a wide insight about 3D programming using OpenSceneGraph, with a set of meaningful and interesting examples.


Read More