Scene Representation How does one describe the objects in a Scene Graphs 3D scene? Scene Graphs State Machine Model API Scene Modeling Languages / API From the low level to the high level State Machine Model State Machine Model -- OpenGL Current “state” of rendering is maintained in global variable or stack. Graph Based Scene Languages Material properties Inventor Object transformation matrix VRML Lights / Camera parameters True Object Oriented Model Languages GROOP Much like a “graphicsContext” State Machine Model API State Machine Model API Open GL OpenGL - scene modeling Originally designed as an API for SGI’s Objects rendering hardware only knows about polygons (different kinds of Very low level “C” programming library polygons, but just polygons) Includes: Polygons are specified by vertex list Scene modeling You are responsible for definition of normal Rendering vector. Animation Some rudimentary and low level interactivity 1
State Machine Model API State Machine Model API OpenGL OpenGL Models a state machine. Maintains current: Transformations Color Routines for scaling, translation, and rotation Transformation (transformation stack) Routines for direct manipulation of transformation matrix Material properties Maintains a stack of transformation matricies New polygonal objects will use current color, for support of object hierarchy transforms and materials. State Machine Model API Scene Graphs Open GL Scene is represented by a tree structure (scene graph) Summary Low level “C” interface Scene graph is passed to a viewer Polygonal model which is responsible for rendering State machine Basis for VRML and Java3D Transformation Stack Other State Model specs RenderMan (RIB) Scene Graphs Scene Graphs Inventor Inventor Object oriented wrapper around GL Scene is represented by a tree structure (scene graph) Not a truly Object Oriented scene representation. Scene graph is passed to a viewer which is Originator of the scene graph responsible for rendering Implemented as C++ library with Basis for VRML and Java3D associated file format. 2
Scene Graphs Scene Graphs Inventor -- Graph Nodes Inventor Shape nodes Camera Nodes represent physical objects Introduces a camera model cone, cylinder, sphere, 3Dtext, triangleMesh, Orthographic/Perspective camera NURB surface Property nodes Lighting Nodes Appearance nodes (texture, color, material) introduces lights to a scene Transformations nodes (scale, rotate, translate) directional, point, spot Other (environment, normal, draw style) Scene Graphs Scene Graphs Inventor Inventor Group nodes Support for definition of “objects” Locally groups subgraphs Switch node (switch between 2 subgraphs) Scene Graphs Scene Graphs Graph Actions Inventor - Rendering Traversal of scene graph for a particular Like OpenGL, Inventor assumes a state purpose. machine. Examples Unlike OpenGL, entire state can be placed on a stack. Rendering Visiting a shape node introduces a new Searching object with “current” properties Compute Bounding Box Interactivity / Picking Visiting a property node is equivalent to Write to file making a given material current. 3
Scene Graphs Scene Modeling Language Inventor - Rendering Inventor - summary Entering a group node pushes current state “Object oriented” wrapper to OpenGL on stack Scene represented as graph Leaving a group node pops current state Actions performed on graphs for specific off stack. purposes (like rendering) Precursor to VRML and Java3D Scene Modeling Language - Scene Modeling Languages VRML VRML Inventor - further reading Virtual Reality Modeling Language [Strauss92] “ an open standard for 3D multimedia and shared virtual worlds on the Internet .” Strauss/Carey, The Inventor Mentor 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 API Based on Inventor file format Scene Modeling Language - Scene Modeling Language - VRML VRML Nodes Have data fields & children Transform { Translation = Xform translation 1.0 1.0 6.5 Node Types (1.0, 1.0, 6.5) children [ Shape { Geometry appearance Appearance { material Material { Appearance diffuseColor 1.0 0.0 0.0 Shape } Transformation } appearance geometry geometry Sphere { radius 1.0 } Sound } Grouping ] Sphere Material } Viewpoint Radius = 1.0 Color = red 4
Scene Modeling Language - Scene Modeling Language - VRML VRML Define Seat (location, mycolor) VRML PROTO Seat [ exposedField SFVec3f location 0.0 0.0 0.0 Translation = exposedField SFColor mycolor 1.0 1.0 1.0 Supports Encapsulation and Reuse Xform location ] Transform { Ability to define new node types translation IS location children [ Shape { PROTO Statement appearance Appearance { Shape material Material { diffuseColor IS myColor appearance } geometry } geometry Sphere { radius 1.0 } } ] Sphere Material } Seat { location 1.0 1.0 6.5 Radius = 1.0 Color = mycolor mycolor 1.0 0.0 0.0} Scene Modeling Language - Scene Modeling Language - VRML VRML PROTO Seat [ exposedField SFVec3f location 0 0 0 Inventor and VRML not a truly OO scene exposedField SFColor mycolor 1.0 1.0 1.0 Seat3 ] … model DEF Seat1 Seat Separation between object and materials { location 1.0 1.0 6.5 mycolor 1.0 0.0 0.0} DEF Seat2 Seat Still based on state machine model. { location 2.0 1.0 6.5 Seat2 Seat4 mycolor 1.0 0.0 0.0} Created for CG user. Still doesn’t fit real world DEF Seat3 Seat { location 3.0 1.0 6.5 paradigm mycolor 1.0 0.0 0.0} DEF Seat4 Seat e.g. We usually aren’t concerned transformation { location 4.0 1.0 6.5 matricies Seat5 mycolor 1.0 0.0 0.0} Seat1 DEF Seat5 Seat Scene Graphs are excellent for specifying object { location 5.0 1.0 6.5 mycolor 1.0 0.0 0.0} heirarchies Color / Location of each seat can be modified by sending messages Scene Modeling Language Scene Modeling Languages GROOP GROOP truly object oriented scene description transformations, material, geometry, and color are all associated with an object uses a camera/actor/stage paradigm. 5
Scene Modeling Language Scene Modeling Languages GROOP GROOP Scene object is a collection of objects in a Extensibility achieved by use of C++ scene. inheritance. Objects are introduced by literally “Adding” them to a scene. Unlike Inventor, order of addition is not important. Scene Modeling Languages Summary GROOP - summary On the road to scene graphs example of a truly object oriented scene Scene Modeling Languages description mechanism State Model Scene Graphs intuitive True Object Oriented Descriptions extensible Questions? Alas, not used….never caught on. Paper Preview -- Week 2 Paper Preview - Week 2 Procedural Models (Mon) Light / Ray Tracing (Wed) [Catmul/Clark78] -- Original B-Spline paper [Whitted80] - The original ray tracing [Doo/Sabin78] -- Splines to polys. paper [Musgrave, etal89] -- Fractal landscapes [Parker, et al99] - Interactive ray tracing [Fournier, et al82] -- Fractals and procedural [Woop, et al 2005] -- RPU: Ray tracing in models hardware [Reeves83] -- 1st particle system paper [Perlin/Hoffert89] -- Hypertexture 6
Recommend
More recommend