OpenSceneGraph 3 Cookbook

OpenSceneGraph 3 Cookbook
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • 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


Book Details

Language : English
Paperback : 426 pages [ 235mm x 191mm ]
Release Date : March 2012
ISBN : 184951688X
ISBN 13 : 9781849516884
Author(s) : Rui Wang, Xuelei Qian
Topics and Technologies : All Books, Game Development, Cookbooks, Open Source, Web Graphics & Video

Table of Contents

Chapter 1: Customizing OpenSceneGraph
Chapter 2: Designing the Scene Graph
Chapter 3: Editing Geometry Models
Chapter 4: Manipulating the View
Chapter 5: Animating Everything
Chapter 6: Designing Creative Effects
Chapter 7: Visualizing the World
Chapter 8: Managing Massive Amounts of Data
Chapter 9: Integrating with GUI
Chapter 10: Miscellaneous Discussion in Depth
  • Chapter 1: 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
    • Chapter 2: 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
      • Chapter 3: 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
        • Chapter 4: 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
          • Chapter 5: 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
            • Chapter 6: 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
              • Chapter 7: 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
                • Chapter 8: 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
                  • Chapter 9: 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
                    • Chapter 10: Miscellaneous Discussion in Depth
                      • This chapter is not present in the book but is available as a free download at the following link:
                      • Introduction
                      • Playing with the Delaunay triangulator
                      • Understanding and using the pseudo loaders
                      • Managing customized data with the metadata system
                      • Designing customized serializers
                      • Reflecting classes with serializers
                      • Taking a photo of the scene
                      • Designing customized intersectors
                      • Implementing the depth peeling method
                      • Using OSG in C# applications
                      • Using osgSwig for language binding
                      • Contributing your code to OSG
                      • Playing with osgEarth: another way to visualize the world
                      • Use osgEarth to display a VPB-generated database

                      Rui Wang

                      Rui Wang is a Software Engineer at Beijing Crystal Digital Technology Co., Ltd. (Crystal CG), in charge of the new media interactive application design and development. He wrote a Chinese book called OpenSceneGraph Design and Implementation in 2009. He also wrote the book OpenSceneGraph 3.0 Beginner's Guide in 2010 and OpenSceneGraph 3.0 Cookbook in 2012, both of which are published by Packt Publishing and co-authored by Xuelei Qian. In his spare time he also writes novels and is a guitar lover.

                      Xuelei Qian

                      Xuelei Qian received his Ph.D. in applied graphic computing from the University of Derby in 2005. From 2006 to 2008 he worked as a post-doctoral research fellow in the Dept. of Precision Instrument and Mechanology at Tsinghua University. In 2008 he was appointed by the School of Scientific Research and Development of Tsinghua University. He is also the Deputy Director of the Overseas R&D Management Office of Tsinghua University and Deputy Secretary in General of UniversityIndustry Cooperation Committee, Tsinghua University.

                      Code Downloads

                      Download the code and support files for this book.

                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      OpenSceneGraph 3 Cookbook +    JIRA 4 Essentials =
                      50% Off
                      the second eBook
                      Price for both: $45.60

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • 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.


                      This is a cookbook full of recipes with practical examples enriched with code and the required screenshots for easy and quick comprehension.

                      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.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software