1
Scene Graphs Scene Representation
How does one describe the objects in a
3D scene?
Scene Graphs
Scene Graphs Scene Representation How does one describe the objects - - PDF document
Scene Graphs Scene Representation How does one describe the objects in a 3D scene? Scene Graphs 1 Scene Modeling Languages / API From the low level to the high level State Machine Model -- OpenGL Graph Based Scene Languages
How does one describe the objects in a
Scene Graphs
From the low level to the high level
State Machine Model -- OpenGL Graph Based Scene Languages
Inventor VRML
True Object Oriented Model Languages
GROOP
State Machine Model
Current “state” of rendering is maintained
Material properties Object transformation matrix Lights / Camera parameters
Much like a “graphicsContext”
Open GL
Originally designed as an API for SGI’s
Very low level “C” programming library Includes:
Scene modeling Rendering Animation Some rudimentary and low level interactivity
OpenGL - scene modeling
Objects
only knows about polygons (different kinds of
Polygons are specified by vertex list You are responsible for definition of normal
OpenGL
Transformations
Routines for scaling, translation, and rotation Routines for direct manipulation of
Maintains a stack of transformation matricies
OpenGL
Models a state machine. Maintains current:
Color Transformation (transformation stack) Material properties
New polygonal objects will use current color,
Open GL
Summary
Low level “C” interface Polygonal model State machine Transformation Stack
Other State Model specs
RenderMan (RIB)
Scene is represented by a tree structure
Scene graph is passed to a viewer
Basis for VRML and Java3D
Inventor
Object oriented wrapper around GL
Not a truly Object Oriented scene
Originator of the scene graph Implemented as C++ library with
Inventor
Scene is represented by a tree structure
Scene graph is passed to a viewer which is
Basis for VRML and Java3D
Inventor -- Graph Nodes
Shape nodes
represent physical objects cone, cylinder, sphere, 3Dtext, triangleMesh,
Lighting Nodes
introduces lights to a scene directional, point, spot
Inventor
Camera Nodes
Introduces a camera model Orthographic/Perspective camera
Property nodes
Appearance nodes (texture, color, material) Transformations nodes (scale, rotate, translate) Other (environment, normal, draw style)
Inventor
Group nodes
Support for definition of “objects” Locally groups subgraphs Switch node (switch between 2 subgraphs)
Inventor
Graph Actions
Traversal of scene graph for a particular
Examples
Rendering Searching Compute Bounding Box Interactivity / Picking Write to file
Inventor - Rendering
Like OpenGL, Inventor assumes a state
Unlike OpenGL, entire state can be placed
Visiting a shape node introduces a new
Visiting a property node is equivalent to
Inventor - Rendering
Entering a group node pushes current state
Leaving a group node pops current state
Inventor - summary
“Object oriented” wrapper to OpenGL Scene represented as graph Actions performed on graphs for specific
Precursor to VRML and Java3D
Inventor - further reading
[Strauss92] Strauss/Carey, The Inventor Mentor
VRML
Virtual Reality Modeling Language “an open standard for 3D multimedia and shared virtual
worlds on the Internet.”
Text-based scene description language Need plug-in/applet for viewing VRML scenes ISO Standard
Originally designed to create virtual worlds as described in
books like Snowcrash.
VRML is a Scene Description Language NOT an
Based on Inventor file format
Nodes
Have data fields & children
Node Types
Geometry Appearance Transformation Sound Grouping Viewpoint
Transform { translation 1.0 1.0 6.5 children [ Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0 } } geometry Sphere { radius 1.0 } } ] } Xform Shape Sphere Material Radius = 1.0 Color = red geometry appearance Translation = (1.0, 1.0, 6.5)
VRML
Supports Encapsulation and Reuse Ability to define new node types PROTO Statement
PROTO Seat [ exposedField SFVec3f location 0.0 0.0 0.0 exposedField SFColor mycolor 1.0 1.0 1.0 ] Transform { translation IS location children [ Shape { appearance Appearance { material Material { diffuseColor IS myColor } } geometry Sphere { radius 1.0 } } ] } Seat { location 1.0 1.0 6.5 mycolor 1.0 0.0 0.0}
Xform Shape Sphere Material Radius = 1.0 Color = mycolor geometry appearance Translation = location
Define Seat (location, mycolor)
PROTO Seat [ exposedField SFVec3f location 0 0 0 exposedField SFColor mycolor 1.0 1.0 1.0 ] … DEF Seat1 Seat { location 1.0 1.0 6.5 mycolor 1.0 0.0 0.0} DEF Seat2 Seat { location 2.0 1.0 6.5 mycolor 1.0 0.0 0.0} DEF Seat3 Seat { location 3.0 1.0 6.5 mycolor 1.0 0.0 0.0} DEF Seat4 Seat { location 4.0 1.0 6.5 mycolor 1.0 0.0 0.0} DEF Seat5 Seat { location 5.0 1.0 6.5 mycolor 1.0 0.0 0.0}
Seat1 Seat2 Seat3 Seat4 Seat5
Inventor and VRML not a truly OO scene
Separation between object and materials Still based on state machine model. Created for CG user. Still doesn’t fit real world
e.g. We usually aren’t concerned transformation
matricies
Scene Graphs are excellent for specifying object
GROOP
truly object oriented scene description transformations, material, geometry, and
uses a camera/actor/stage paradigm.
GROOP
GROOP
Scene object is a collection of objects in a
Objects are introduced by literally “Adding”
Unlike Inventor, order of addition is not
GROOP
Extensibility achieved by use of C++
GROOP - summary
example of a truly object oriented scene
intuitive extensible Alas, not used….never caught on.
On the road to scene graphs
Scene Modeling Languages State Model Scene Graphs True Object Oriented Descriptions
Questions?