Before we begin Paper summaries for today? Objects and - - PDF document

before we begin
SMART_READER_LITE
LIVE PREVIEW

Before we begin Paper summaries for today? Objects and - - PDF document

Before we begin Paper summaries for today? Objects and Transformations Setting up your scene Computer Graphics as Virtual Photography Defining your 3D world real camera photo Photographic Photography: scene (captures processing


slide-1
SLIDE 1

1

Objects and Transformations Before we begin

  • Paper summaries for today?

Computer Graphics as Virtual Photography

camera (captures light) synthetic image camera model (focuses simulated lighting)

processing

photo processing tone reproduction real scene 3D models Photography: Computer Graphics: Photographic print

Setting up your scene

  • Defining your 3D world

– Lights

  • Define lighting
  • Place in your world

– Objects

  • Define objects
  • Define material characteristics
  • Place in the world

Plan

  • Today – 1st half

– Objects – Transformation – Scene Specification

  • Today – 2nd half

– Procedural Models – Ray Tracing Assignment / Part 1

Some announcements

  • Computer Animation Festival Screening

– Tuesday, September 13 – Room 7A-1315 – 6pm (right after class)

slide-2
SLIDE 2

2

Another announcement

  • Maya courses

– From School of Design – Open slots for non-Major – Contact Marla Schweppe (Marla.Schweppe@rit.edu) Modeling T 10-12 R 8-12 Lighting MW 12-2

One more announcement

  • Electronic Arts (EA) is coming to RIT.

– Looking for a few (actually more than a few) good gaming programmers – EA Company Presentation

  • Tuesday, October 4th
  • 6-8pm
  • Golisano auditorium

– Interviews

  • Wednesday, October 5th (Career Center)

Defining Objects

  • Objects are defined mathematically in a

local coordinate system.

  • Once defined, these objects are placed,

transformed and oriented into a 3d world.

Specification vs Representation

  • Specification – means by which a user can

specify an object / shape

  • Representation – structure used by

rendering system in performing actual rendering

  • Conversion implied

Polygonal Models

  • Computer Graphics…where the polygon is

king!

– Basic geometry for most rendering engines – Objects described mathematically usually converted to polygons before rendering.

Polygonal Meshes

  • Surface given by a set of connected

polygons.

– Compact representation – Polygonal mathematics is fairly straight forward. – Rendering hardware optimized for rendering polygons.

slide-3
SLIDE 3

3

Polygonal Meshes

  • Quad Strips
  • Triangle Strips

– guaranteed to lie in same plane

Polygonal Meshes

  • A note about using polygons

– Normals need to be specified

  • Most shading algorithms make use of the normal.
  • Many modelers will produce the normals for you.
  • Perturbing normals can produce interesting effects

(but more on that when we get to shading)

– Questions

Sample Specifications

  • Surfaces of revolution
  • Constructive Solid Geometry
  • NURBS

Quadratic Surfaces

  • Surfaces of Revolution

– curve in 2D is swept in 3D space around an axis. – Surface is given by mathematical expression.

Surfaces of Revolution

sphere cone cylinder paraboloid hyperboloid torus

Constructive Solid Geometry

  • A solid modeling method that combines

simple solid shapes called PRIMITIVES to build more complex models, using the BOOLEAN OPERATORS: UNION, DIFFERENCE, and INTERSECTION.

slide-4
SLIDE 4

4

Constructive Solid Geometry

A B B – A B ∩ A B ∪ A

Parametric Models

  • x, y, z coordinates given as a function of

some other variable t.

  • Also defined in terms of mathematical

(using polynominal) expressions

– Surface is shaped by manipulating control points

  • Splines, NURBS.

Parametric Models

  • x, y, z given as function of t
  • Approximated by cubic polynomials

x x x x

d t c t b t a t x + + + =

2 3

) (

y y y y

d t c t b t a t y + + + =

2 3

) (

z z z z

d t c t b t a t z + + + =

2 3

) (

Parametric Models

  • Basis Matrix + Set of Control Points

4 4 3 4 4 2 1 4 4 4 4 3 4 4 4 4 2 1

points control 4 3 2 1 4 3 2 1 4 3 2 1 matrix basis 44 43 42 41 34 33 32 31 24 23 22 21 14 13 12 11

⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

z z z z y y y y x x x x

G G G G G G G G G G G G m m m m m m m m m m m m m m m m C

Parametric Models

  • Curve Types

– Interpolating

  • Hermite – endpoints + tangent vector
  • Bezier – endpoints + control points

– Approximating / C2 continuity

  • B-Splines

– NURBS

  • Non-Uniform Rational B-Splines
  • Can describe conic curves
  • Localized control
  • Intuitive Interface
  • Common interchange format?

– Curves applet

  • http://www.cc.gatech.edu/gvu/multimedia/nsfmmedia/graphics/edulib/Solomo

n/CurveDraw.html

Parametric Models

  • Curves to surfaces

NURBS modeler

Rhino3D: http://www.rhino3d.com

slide-5
SLIDE 5

5

Coordinate Transformations

  • How to specify placement of individual
  • bjects into a scene
  • Two coordinate systems

– Object coordinate system – World coordinate system

  • A Third coordinate system

– Camera coordinate system

Coordinate Transformations

  • Homogeneous Coordinates

– Add 4th dimensional value defined as:

  • (x,y,z) -> (x, y, z, 1)
  • (x,y,z,w) -> (x/w, y/w, z/w)
  • Why?

– Can’t represent translation as a matrix operation without it. – Easily incorporate projections into transformation model

Coordinate Transformation

  • Transformation Matrix

{ {

  • bject

tion transforma 44 43 42 41 34 33 32 31 24 23 22 21 14 13 12 11 world

1 1 ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⋅ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡

  • w

w w

z y x m m m m m m m m m m m m m m m m z y x 4 4 4 4 3 4 4 4 4 2 1

Coordinate Transformation

  • Transform operations

– Scaling – Translation – Rotation

Coordinate Transformation

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 ) , , (

z y x z y x

s s s s s s S

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 1 ) , , (

z y x z y x

d d d d d d T

Scaling – make an

  • bject bigger/smaller

Translation – move and object

Coordinate Transformation

  • Rotation

– rotate object about a given axis

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 1 cos sin sin cos ) ( θ θ θ θ θ

z

R ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 cos sin sin cos 1 ) ( θ θ θ θ θ

x

R ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 cos sin 1 sin cos ) ( θ θ θ θ θ

y

R

slide-6
SLIDE 6

6

Coordinate Transformations

  • Individual operations can be composed into

a single matrix.

x y

R S T R M ⋅ ⋅ ⋅ =

Coordinate Transformation

  • Beware: Transformation is not

communitive

T R S R R S T R

x y x y

⋅ ⋅ ⋅ ≠ ⋅ ⋅ ⋅

Coordinate Transformation

  • So how do you transform objects?

– On a point by point basis – Perform transformations (matrix multiplications) in homogeneous space – Translate back to Euclidean space using definition:

  • (x,y,z,w) -> (x/w, y/w, z/w)

– Questions?

Object Hierarchy

  • Wish to rotate wrt p

B A p

Object Hierarchy

  • TBW = transformation of B wrt world
  • TAW = transformation of A wrt world
  • TBA= transformation of B wrt A

AW BA BW

T T T ⋅ =

To rotate about p, change TBA

Object Hierarchy

  • Most rendering systems / API maintain a

transformation matrix stack

– Push when going into the hierarchy – Pop when leaving the hierarchy

slide-7
SLIDE 7

7

Object Hierarchy

  • Stack of transformation matrices

Arm wrt body Body wrt world Hand wrt arm Finger wrt hand

Object Hierarchy

  • Object Hierarchy applets

– http://www.cs.brown.edu/exploratories/freeSoftware/re pository/edu/brown/cs/exploratories/applets/transformat ionHierarchy/transformation_hierarchy_guide.html – http://www.cs.brown.edu/exploratories/freeSoftware/re pository/edu/brown/cs/exploratories/applets/transformP ropagation/transform_propagation_guide.html

Specifying the Scene

  • From the low level to the high level

– State Machine Model -- OpenGL – Scene Graph

  • Inventor
  • VRML/X3D
  • Java3D

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’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-8
SLIDE 8

8

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

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

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-9
SLIDE 9

9

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

Summary

  • Scene Modeling

– means of assembling objects into a scene

  • Geometric Primitives
  • Coordinate Transformations
  • Scene Specification
slide-10
SLIDE 10

10

Break

  • Time for a Break