E-book details

OpenSceneGraph 3.0: Beginner's Guide. This book is a concise introduction to the main features of OpenSceneGraph which then leads you into the fundamentals of developing virtual reality applications. Practical instructions and explanations accompany you every step of the way

OpenSceneGraph 3.0: Beginner's Guide. This book is a concise introduction to the main features of OpenSceneGraph which then leads you into the fundamentals of developing virtual reality applications. Practical instructions and explanations accompany you every step of the way

Xuelei Qian, Rui Wang, Robert Osfield

Ebook
Virtual reality has quite a lot of demand in computer science today and OpenSceneGraph, being one of the best 3D graphics toolkits, is being used widely. Although you can use the powerful OpenSceneGraph, based on the low-level OpenGL API, to implement virtual-reality applications that simulate different environments in the 3D world, developing picture-perfect applications is easier said than done.This book has been written with the goal of helping readers become familiar with the structure and main functionalities of OpenSceneGraph (OSG), and guide them to develop virtual-reality applications using this powerful 3D graphics engine. This book covers the essence of OpenSceneGraph (OSG), providing programmers with detailed explanations and examples of scene graph APIs.This book helps you take full advantages of the key features and functionalities of OpenSceneGraph (OSG). You will learn almost all of the core elements required in a virtual reality application, including memory management, geometry creation, the structure of the scene graph, realistic rendering effects, scene navigation, animation, interaction with input devices and external user interfaces, file reading and writing, and so on.

With the essential knowledge contained in this book, you will be able to start using OSG in your own projects and research fields, and extend its functionalities by referring to OSG's source code, official examples and API documentation.

This handy book divides the core functionalities of the proved and comprehensive OpenSceneGraph (OSG) 3D graphics engine into different aspects, which are introduced in separate chapters. Each chapter can be treated as an individual part that covers one important field of OSG programming, along with several examples illustrating concrete usages and solutions. But the sequence of chapters is also organized from the easy to the more difficult, to help you get to grips with OSG.By the end of the whole book, you will have gained a ready-to-use OSG development environment for yourself and have the general ability to develop OSG-based applications and extend practical functionalities for your own purposes.
  • OpenSceneGraph 3.0
    • Table of Contents
    • OpenSceneGraph 3.0
    • Credits
    • Foreword
    • About the Authors
    • Acknowledgement
    • About the Reviewers
    • www.PacktPub.com
      • Support files, eBooks, discount offers and more
        • Why Subscribe?
        • Free Access for Packt account holders
    • Preface
      • What this book covers
      • What you need for this book
      • Who this book is for
      • Conventions
      • Time for actionheading
        • What just happened?
        • Pop quizheading
        • Have a go heroheading
      • Reader feedback
      • Customer support
        • Errata
        • Piracy
        • Questions
    • 1. The Journey into OpenSceneGraph
      • A quick overview of rendering middleware
      • Scene graphs
      • The Birth and development of OSG
      • Components
      • Why OSG?
      • Who uses OSG?
      • Have a quick taste
      • Time for actionsay "Hello World" OSG style
        • What just happened?
      • Live in community
      • Summary
    • 2. Compilation and Installation of OpenSceneGraph
      • System requirements
      • Using the installer
      • Time for actioninstalling OSG
        • What just happened?
      • Running utilities
      • Time for actionplaying with osgviewer
        • What just happened?
        • Pop quizdependencies of osgviewer
        • Have a go heroplaying with osgconv
      • Using the project wizard
      • Time for actioncreating your solution with one click
        • What just happened?
        • Have a go heroconstructing "Hello World" with the wizard
      • Prebuilts making trouble?
      • Cross-platform building
      • Starting CMake
      • Time for actionrunning CMake in GUI mode
        • What just happened?
      • Setting up options
      • Generating packages using Visual Studio
      • Time for actionbuilding with a Visual Studio solution
        • What just happened?
        • Pop quizthe difference between ALL_BUILD and build all'
      • Generating packages using gcc
      • Time for actionbuilding with a UNIX makefile
        • What just happened?
        • Have a go herochecking mis-compiled parts
      • Configuring environment variables
      • Summary
    • 3. Creating Your First OSG Program
      • Constructing your own projects
      • Time for actionbuilding applications with CMake
        • What just happened?
        • Pop quizconfiguring OSG path options yourselves
        • Have a go herotesting with different generators
      • Using a root node
      • Time for actionimproving the "Hello World" example
        • What just happened?
      • Understanding memory management
      • ref_ptr<> and Referenced classes
      • Collecting garbage: why and how
      • Tracing the managed entities
      • Time for actionmonitoring counted objects
        • What just happened?
        • Have a go heroreturning from a function
        • Pop quizrelease a smart pointer
      • Parsing command-line arguments
      • Time for actionreading the model filename from the command line
        • What just happened?
      • Tracing with the notifier
      • Redirecting the notifier
      • Time for actionsaving the log file
        • What just happened?
      • Summary
    • 4. Building Geometry Models
      • How OpenGL draws objects
      • Geode and Drawable classes
      • Rendering basic shapes
      • Time for actionquickly creating simple objects
        • What just happened?
      • Storing array data
      • Vertices and vertex attributes
      • Specifying drawing types
      • Time for actiondrawing a colored quad
        • What just happened?
        • Pop quizresults of different primitive types
      • Indexing primitives
      • Time for actiondrawing an octahedron
        • What just happened?
        • Pop quizoptimizing indexed geometries
        • Have a go herochallenges with cubes and pyramids
      • Using polygonal techniques
      • Time for actiontessellating a polygon
        • What just happened?
      • Rereading geometry attributes
      • Customizing a primitive functor
      • Time for actioncollecting triangle faces
        • What just happened?
        • Have a go heroanalyzing topology of a geometry
      • Implementing your own drawables
      • Using OpenGL drawing calls
      • Time for actioncreating the famous OpenGL teapot
        • What just happened?
      • Summary
    • 5. Managing Scene Graph
      • The Group interface
      • Managing parent nodes
      • Time for actionadding models to the scene graph
        • What just happened?
        • Pop quizfast dynamic casting
      • Traversing the scene graph
      • Transformation nodes
      • Understanding the matrix
      • The MatrixTransform class
      • Time for actionperforming translations of child nodes
        • What just happened?
        • Pop quizmatrix multiplications
        • Have a go heromaking use of the PositionAttitudeTransform class
      • Switch nodes
      • Time for actionswitching between the normal and damaged Cessna
        • What just happened?
      • Level-of-detail nodes
      • Time for actionconstructing a LOD Cessna
        • What just happened?
      • Proxy and paging nodes
      • Time for actionloading a model at runtime
        • What just happened?
        • Have a go heroworking with the PagedLOD class
      • Customizing your own NodeKits
      • Time for actionanimating the switch node
        • What just happened?
        • Have a go herocreating a tracker node
      • The visitor design pattern
      • Visiting scene graph structures
      • Time for actionanalyzing the Cessna structure
        • What just happened?
      • Summary
    • 6. Creating Realistic Rendering Effects
      • Encapsulating the OpenGL state machine
      • Attributes and modes
      • Time for actionsetting polygon modes of different nodes
        • What just happened?
      • Inheriting render states
      • Time for actionlighting the glider or not
        • What just happened?
      • Playing with fixed-function effects
      • Time for actionapplying simple fog to models
        • What just happened?
        • Have a go herosearching for more effects
      • Lights and light sources
      • Time for actioncreating light sources in the scene
        • What just happened?
        • Pop quizlights without sources
      • The Image class
      • The basis of texture mapping
      • Time for actionloading and applying 2D textures
        • What just happened?
        • Have a go heromaking use of filters and wrapping modes
      • Handling rendering order
      • Time for actionachieving the translucent effect
        • What just happened?
      • Understanding graphics shaders
      • Using uniforms
      • Time for actionimplementing a cartoon cow
        • What just happened?
        • Pop quizreplacements of built-in uniforms
        • Have a go herosetting vertex attributes to shaders
      • Working with the geometry shader
      • Time for actiongenerating a Bezier curve
        • What just happened?
        • Have a go herohaving fun with shaders
      • Summary
    • 7. Viewing the World
      • From world to screen
      • The Camera class
      • Rendering order of cameras
      • Time for actioncreating an HUD camera
        • What just happened?
        • Pop quizchanging model positions in the HUD camera
      • Using a single viewer
      • Digging into the simulation loop
      • Time for actioncustomizing the simulation loop
        • What just happened?
        • Have a go heroviewing in a non-full screen window
      • Using a composite viewer
      • Time for actionrendering more scenes at one time
        • What just happened?
        • Have a go herodifferent views of the same scene
        • Pop quizanother way to display the same scene in different views
      • Changing global display settings
      • Time for actionenabling global multisampling
        • What just happened?
      • Stereo visualization
      • Time for actionrendering anaglyph stereo scenes
        • What just happened?
      • Rendering to textures
      • Frame buffer, pixel buffer, and FBO
      • Time for actiondrawing aircrafts on a loaded terrain
        • What just happened?
        • Have a go herosaving scene to an image file
      • Summary
    • 8. Animating Scene Objects
      • Taking references to functions
      • List of callbacks
      • Time for actionswitching nodes in the update traversal
        • What just happened?
        • Pop quizadding or setting callbacks
      • Avoiding conflicting modifications
      • Time for actiondrawing a geometry dynamically
        • What just happened?
        • Have a go herodirtying geometry objects
      • Understanding ease motions
      • Animating the transformation nodes
      • Time for actionmaking use of the animation path
        • What just happened?
        • Have a go heromore controls over the animation path
      • Changing rendering states
      • Time for actionfading in
        • What just happened?
        • Pop quizchoosing the alpha setter and the callback
        • Have a go heroanimating in graphics shaders
      • Playing movies on textures
      • Time for actionrendering a flashing spotlight
        • What just happened?
      • Creating complex key-frame animations
      • Channels and animation managers
      • Time for actionmanaging animation channels
        • What just happened?
      • Loading and rendering characters
      • Time for actioncreating and driving a character system
        • What just happened?
        • Have a go heroanalyzing the structure of your character
      • Summary
    • 9. Interacting with Outside Elements
      • Various events
      • Handling mouse and keyboard inputs
      • Time for actiondriving the Cessna
        • What just happened?
        • Pop quizhandling events within nodes
        • Have a go heromanipulating the cameras
      • Adding customized events
      • Time for actioncreating a user timer
        • What just happened?
        • Pop quizglobal and node-related events
      • Picking objects
      • Intersection
      • Time for actionclicking and selecting geometries
        • What just happened?
        • Have a go heroselecting geometries in a rectangular region
      • Windows, graphics contexts, and cameras
      • The Traits class
      • Time for actionconfiguring the traits of a rendering window
        • What just happened?
      • Integrating OSG into a window
      • Time for actionattaching OSG with a window handle in Win32
        • What just happened?
        • Have a go heroembedding into GUI systems
      • Summary
    • 10. Saving and Loading Files
      • Understanding file I/O plugins
      • Discovery of specified extension
      • Supported file formats
      • The pseudo-loader
      • Time for actionreading files from the Internet
        • What just happened?
        • Pop quizgetting rid of pseudo-loaders
      • Configuring third-party dependencies
      • Time for actionadding libcurl support for OSG
        • What just happened?
        • Have a go heroadding FreeType support for OSG
      • Writing your own plugins
      • Handling the data stream
      • Time for actiondesigning and parsing a new file format
        • What just happened?
        • Have a go herofinishing the writing interface of the plugin
      • Serializing OSG native scenes
      • Creating serializers
      • Time for actioncreating serializers for user-defined classes
        • What just happened?
        • Pop quizunderstanding the inheritance relations
        • Have a go heroadding more serializers
      • Summary
    • 11. Developing Visual Components
      • Creating billboards in a scene
      • Time for actioncreating banners facing you
        • What just happened?
        • Have a go heroplanting massive trees on the ground
      • Creating texts
      • Time for actionwriting descriptions for the Cessna
        • What just happened?
        • Pop quiztext positions and the projection matrix
        • Have a go herousing wide characters to support more languages
      • Creating 3D texts
      • Time for actioncreating texts in the world space
        • What just happened?
      • Creating particle animations
      • Time for actionbuilding a fountain in the scene
        • What just happened?
        • Have a go herodesigning a rotary sprinkler
      • Creating shadows on the ground
      • Time for actionreceiving and casting shadows
        • What just happened?
        • Have a go herotesting other shadow techniques
      • Implementing special effects
      • Time for actiondrawing the outline of models
        • What just happened?
      • Playing with more NodeKits
      • Summary
    • 12. Improving Rendering Efficiency
      • OpenThreads basics
      • Time for actionusing a separate data receiver thread
        • What just happened?
        • Pop quizcarefully blocking threads
      • Understanding multithreaded rendering
      • Time for actionswitching between different threading models
        • What just happened?
      • Dynamic scene culling
      • Occluders and occludees
      • Time for actionadding occluders to a complex scene
        • What just happened?
        • Have a go heroadding holes to the occluder
      • Improving your application
      • Time for actionsharing textures with a customized callback
        • What just happened?
        • Have a go herosharing public models
      • Paging huge scene data
      • Making use of the quad-tree
      • Time for actionbuilding a quad-tree for massive rendering
        • What just happened?
        • Pop quiznumber of created levels and files
        • Have a go herotesting a new terrain creation tool
      • Summary
    • A. Pop quizAnswers
      • Chapter 2
        • Dependencies of osgviewer
        • The difference between ALL_BUILD and 'build all'
      • Chapter 3
        • Configuring OSG path options yourselves
        • Release a smart pointer
      • Chapter 4
        • Results of different primitive types
        • Optimizing indexed geometries
      • Chapter 5
        • Fast dynamic casting
        • Matrix multiplications
      • Chapter 6
        • Lights without sources
        • Replacements of built-in uniforms
      • Chapter 7
        • Changing model positions in the HUD camera
        • Another way to display the same scene in different views
      • Chapter 8
        • Adding or setting callbacks
        • Choosing the alpha setter and the callback
      • Chapter 9
        • Handling events within nodes
        • Global and node-related events
      • Chapter 10
        • Getting rid of pseudo-loaders
        • Understanding the inheritance relations
      • Chapter 11
        • Text positions and the projection matrix
      • Chapter 12
        • Carefully blocking threads
        • Number of created levels and files
    • Index
  • Title: OpenSceneGraph 3.0: Beginner's Guide. This book is a concise introduction to the main features of OpenSceneGraph which then leads you into the fundamentals of developing virtual reality applications. Practical instructions and explanations accompany you every step of the way
  • Author: Xuelei Qian, Rui Wang, Robert Osfield
  • Original title: OpenSceneGraph 3.0: Beginner's Guide. This book is a concise introduction to the main features of OpenSceneGraph which then leads you into the fundamentals of developing virtual reality applications. Practical instructions and explanations accompany you every step of the way.
  • ISBN: 9781849512831, 9781849512831
  • Date of issue: 2010-12-14
  • Format: Ebook
  • Item ID: e_3azp
  • Publisher: Packt Publishing