Transcript
Page 1: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

1

Scene Graphs

Scene Representation

How does one describe the objects in a3D scene?

Scene Graphs

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”

State Machine Model API Open GL

Originally designed as an API for SGI’srendering 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 ofpolygons, but just polygons)

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

vector.

Page 2: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

2

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.

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 viewerwhich is responsible for rendering

Basis for VRML and Java3D

Scene Graphs

Inventor Object oriented wrapper around GL

Not a truly Object Oriented scenerepresentation.

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

Page 3: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

3

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)

Scene Graphs

Inventor Group nodes

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

Scene Graphs

Inventor

Scene Graphs Graph Actions

Traversal of scene graph for a particularpurpose.

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

Scene Graphs Inventor - Rendering

Like OpenGL, Inventor assumes a statemachine.

Unlike OpenGL, entire state can be placedon a stack.

Visiting a shape node introduces a newobject with “current” properties

Visiting a property node is equivalent tomaking a given material current.

Page 4: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

4

Scene Graphs

Inventor - Rendering Entering a group node pushes current state

on stack Leaving a group node pops current state

off 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

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 inbooks like Snowcrash.

VRML is a Scene Description Language NOT anAPI

Based on Inventor file format

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)

Page 5: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

5

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)

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 canbe modified by sending messages

Scene Modeling Language -VRML

Inventor and VRML not a truly OO scenemodel 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 objectheirarchies

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

Page 6: Scene Representation Scene Graphs - Computer …jmg/courses/cgII/20061/slides/1-2-scenegraph.pdfNot a truly Object Oriented scene representation. ... Inventor - Rendering

6

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.

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?

Paper Preview -- Week 2 Procedural Models (Mon)

[Catmul/Clark78] -- Original B-Spline paper [Doo/Sabin78] -- Splines to polys. [Musgrave, etal89] -- Fractal landscapes [Fournier, et al82] -- Fractals and procedural

models [Reeves83] -- 1st particle system paper [Perlin/Hoffert89] -- Hypertexture

Paper Preview - Week 2

Light / Ray Tracing (Wed) [Whitted80] - The original ray tracing

paper [Parker, et al99] - Interactive ray tracing [Woop, et al 2005] -- RPU: Ray tracing in

hardware


Recommended