PacktLib: OpenSceneGraph 3 Cookbook

OpenSceneGraph 3 Cookbook

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Customizing OpenSceneGraph

Introduction

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

Designing the Scene Graph

Introduction

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

Editing Geometry Models

Introduction

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

Manipulating the View

Introduction

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

Animating Everything

Introduction

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

Designing Creative Effects

Introduction

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

Visualizing the World

Introduction

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

Managing Massive Amounts of Data

Introduction

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

Integrating with GUI

Introduction

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