0%

Book Description

Exactly 100 recipes to show advanced 3D programming techniques with the OpenSceneGraph API.

  • 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

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.

Table of Contents

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