Scene Graphs Scene Representation How does one describe the objects - - PDF document

scene graphs scene representation
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1

Scene Graphs Scene Representation

 How does one describe the objects in a

3D scene?

 Scene Graphs

slide-2
SLIDE 2

2

Scene Modeling Languages / API

 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 API

 State Machine Model

 Current “state” of rendering is maintained

in global variable or stack.

 Material properties  Object transformation matrix  Lights / Camera parameters

 Much like a “graphicsContext”

slide-3
SLIDE 3

3

State Machine Model API

 Open GL

 Originally designed as an API for SGI’s

rendering hardware

 Very low level “C” programming library  Includes:

 Scene modeling  Rendering  Animation  Some rudimentary and low level interactivity

State Machine Model API

 OpenGL - scene modeling

 Objects

 only knows about polygons (different kinds of

polygons, but just polygons)

 Polygons are specified by vertex list  You are responsible for definition of normal

vector.

slide-4
SLIDE 4

4

State Machine Model API

 OpenGL

 Transformations

 Routines for scaling, translation, and rotation  Routines for direct manipulation of

transformation matrix

 Maintains a stack of transformation matricies

for support of object hierarchy

State Machine Model API

 OpenGL

 Models a state machine. Maintains current:

 Color  Transformation (transformation stack)  Material properties

 New polygonal objects will use current color,

transforms and materials.

slide-5
SLIDE 5

5

State Machine Model API

 Open GL

 Summary

 Low level “C” interface  Polygonal model  State machine  Transformation Stack

 Other State Model specs

 RenderMan (RIB)

Scene Graphs

 Scene is represented by a tree structure

(scene graph)

 Scene graph is passed to a viewer

which is responsible for rendering

 Basis for VRML and Java3D

slide-6
SLIDE 6

6

Scene Graphs

 Inventor

 Object oriented wrapper around GL

 Not a truly Object Oriented scene

representation.

 Originator of the scene graph  Implemented as C++ library with

associated file format.

Scene Graphs

 Inventor

 Scene is represented by a tree structure

(scene graph)

 Scene graph is passed to a viewer which is

responsible for rendering

 Basis for VRML and Java3D

slide-7
SLIDE 7

7

Scene Graphs

 Inventor -- Graph Nodes

 Shape nodes

 represent physical objects  cone, cylinder, sphere, 3Dtext, triangleMesh,

NURB surface

 Lighting Nodes

 introduces lights to a scene  directional, point, spot

Scene Graphs

 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)

slide-8
SLIDE 8

8

Scene Graphs

 Inventor

 Group nodes

 Support for definition of “objects”  Locally groups subgraphs  Switch node (switch between 2 subgraphs)

Scene Graphs

 Inventor

slide-9
SLIDE 9

9

Scene Graphs

 Graph Actions

 Traversal of scene graph for a particular

purpose.

 Examples

 Rendering  Searching  Compute Bounding Box  Interactivity / Picking  Write to file

Scene Graphs

 Inventor - Rendering

 Like OpenGL, Inventor assumes a state

machine.

 Unlike OpenGL, entire state can be placed

  • n a stack.

 Visiting a shape node introduces a new

  • bject with “current” properties

 Visiting a property node is equivalent to

making a given material current.

slide-10
SLIDE 10

10

Scene Graphs

 Inventor - Rendering

 Entering a group node pushes current state

  • n stack

 Leaving a group node pops current state

  • ff stack.

Scene Modeling Language

 Inventor - summary

 “Object oriented” wrapper to OpenGL  Scene represented as graph  Actions performed on graphs for specific

purposes (like rendering)

 Precursor to VRML and Java3D

slide-11
SLIDE 11

11

Scene Modeling Languages

 Inventor - further reading

 [Strauss92]  Strauss/Carey, The Inventor Mentor

Scene Modeling Language - VRML

 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

API

 Based on Inventor file format

slide-12
SLIDE 12

12

Scene Modeling Language - VRML

 Nodes

 Have data fields & children

 Node Types

 Geometry  Appearance  Transformation  Sound  Grouping  Viewpoint

Scene Modeling Language - VRML

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)

slide-13
SLIDE 13

13

Scene Modeling Language - VRML

 VRML

 Supports Encapsulation and Reuse  Ability to define new node types  PROTO Statement

Scene Modeling Language - VRML

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)

slide-14
SLIDE 14

14

Scene Modeling Language - VRML

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

Color / Location of each seat can be modified by sending messages

Scene Modeling Language - VRML

 Inventor and VRML not a truly OO scene

model

 Separation between object and materials  Still based on state machine model.  Created for CG user. Still doesn’t fit real world

paradigm

 e.g. We usually aren’t concerned transformation

matricies

 Scene Graphs are excellent for specifying object

heirarchies

slide-15
SLIDE 15

15

Scene Modeling Language

 GROOP

 truly object oriented scene description  transformations, material, geometry, and

color are all associated with an object

 uses a camera/actor/stage paradigm.

Scene Modeling Languages

 GROOP

slide-16
SLIDE 16

16

Scene Modeling Language

 GROOP

 Scene object is a collection of objects in a

scene.

 Objects are introduced by literally “Adding”

them to a scene.

 Unlike Inventor, order of addition is not

important.

Scene Modeling Languages

 GROOP

 Extensibility achieved by use of C++

inheritance.

slide-17
SLIDE 17

17

Scene Modeling Languages

 GROOP - summary

 example of a truly object oriented scene

description mechanism

 intuitive  extensible  Alas, not used….never caught on.

Summary

 On the road to scene graphs

 Scene Modeling Languages  State Model  Scene Graphs  True Object Oriented Descriptions

 Questions?