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 print – Lights light) • Define lighting processing • Place in your world – Objects • Define objects camera Computer 3D tone synthetic model Graphics: models image reproduction • Define material characteristics (focuses • Place in the world simulated lighting) Plan Some announcements • Today – 1 st half – Objects – Transformation • Computer Animation Festival Screening – Scene Specification – Tuesday, September 13 • Today – 2 nd half – Room 7A-1315 – Procedural Models – 6pm (right after class) – Ray Tracing Assignment / Part 1 1
Another announcement One more announcement • Maya courses • Electronic Arts (EA) is coming to RIT. – Looking for a few (actually more than a few) good – From School of Design gaming programmers – Open slots for non-Major Lighting Modeling – EA Company Presentation • Tuesday, October 4 th MW 12-2 T 10-12 • 6-8pm R 8-12 • Golisano auditorium – Contact Marla Schweppe – Interviews (Marla.Schweppe@rit.edu) • Wednesday, October 5 th (Career Center) Defining Objects Specification vs Representation • Specification – means by which a user can • Objects are defined mathematically in a specify an object / shape local coordinate system. • Representation – structure used by • Once defined, these objects are placed, rendering system in performing actual transformed and oriented into a 3d world. rendering • Conversion implied Polygonal Models Polygonal Meshes • Computer Graphics…where the polygon is • Surface given by a set of connected king! polygons. – Basic geometry for most rendering engines – Compact representation – Objects described mathematically usually – Polygonal mathematics is fairly straight converted to polygons before rendering. forward. – Rendering hardware optimized for rendering polygons. 2
Polygonal Meshes Polygonal Meshes • Quad Strips • A note about using polygons • Triangle Strips – Normals need to be specified – guaranteed to lie in • Most shading algorithms make use of the normal. same plane • 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 Quadratic Surfaces • Surfaces of revolution • Surfaces of Revolution – curve in 2D is swept in 3D space around an • Constructive Solid Geometry axis. • NURBS – Surface is given by mathematical expression. Surfaces of Revolution Constructive Solid Geometry • A solid modeling method that combines simple solid shapes called PRIMITIVES to build more complex models, using the paraboloid sphere BOOLEAN OPERATORS: UNION, DIFFERENCE, and INTERSECTION. hyperboloid cone torus cylinder 3
Constructive Solid Geometry Parametric Models • x, y, z coordinates given as a function of some other variable t. • Also defined in terms of mathematical A B (using polynominal) expressions – Surface is shaped by manipulating control points B ∩ A B ∪ A B – A • Splines, NURBS. Parametric Models Parametric Models • Basis Matrix + Set of Control Points • x, y, z given as function of t • Approximated by cubic polynomials ⎡ ⎤ ⎡ ⎤ m m m m G G G = + + + 3 2 1 y 11 12 13 14 1 x 1 z x ( t ) a t b t c t d ⎢ ⎥ ⎢ ⎥ x x x x G m m m m G G ⎢ ⎥ ⎢ ⎥ = 21 22 23 24 2 x 2 y 2 z = + + + C 3 2 ⎢ ⎥ y ( t ) a t b t c t d ⎢ ⎥ G m m m m G G y y y y 3 y ⎢ 31 32 33 34 ⎥ ⎢ 3 x 3 z ⎥ = + + + ⎢ ⎥ G 3 2 ⎣ m m m m ⎦ ⎣ G G ⎦ z ( t ) a t b t c t d 1 4 41 4 4 4 42 2 4 43 4 4 4 44 3 4 x 4 y 4 z 1 4 2 4 4 3 4 z z z z basis matrix control points Parametric Models Parametric Models • Curve Types • Curves to surfaces – 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? � NURBS modeler – Curves applet • http://www.cc.gatech.edu/gvu/multimedia/nsfmmedia/graphics/edulib/Solomo � Rhino3D: http://www.rhino3d.com n/CurveDraw.html 4
Coordinate Transformations Coordinate Transformations • How to specify placement of individual • Homogeneous Coordinates – Add 4 th dimensional value defined as: objects into a scene • (x,y,z) -> (x, y, z, 1) • Two coordinate systems • (x,y,z,w) -> (x/w, y/w, z/w) – Object coordinate system • Why? – World coordinate system – Can’t represent translation as a matrix operation without it. • A Third coordinate system – Easily incorporate projections into transformation – Camera coordinate system model Coordinate Transformation Coordinate Transformation • Transformation Matrix • Transform operations ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ x m m m m x – Scaling w 11 12 13 14 o ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ – Translation y m m m m y ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = ⋅ w 21 22 23 24 o – Rotation ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ z m m m m z w 31 32 33 34 o ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ ⎣ ⎦ ⎣ ⎦ 1 m m m m 1 { 1 4 41 4 4 4 42 2 4 43 4 4 4 44 3 { world object transforma tion Coordinate Transformation Coordinate Transformation • Rotation ⎡ ⎤ 1 0 0 d ⎡ ⎤ s 0 0 0 – rotate object about a given axis x ⎢ ⎥ x ⎢ ⎥ 0 1 0 d 0 s 0 0 ⎢ ⎥ ⎢ ⎥ = = y y ⎡ ⎤ ⎡ θ θ ⎤ T ( d , d , d ) S ( s , s , s ) 1 0 0 0 cos 0 sin 0 ⎢ ⎥ ⎢ ⎥ x y z x y z ⎢ ⎥ 0 0 1 d ⎢ ⎥ 0 0 s 0 θ − θ 0 1 0 0 ⎢ z ⎥ ⎢ z ⎥ 0 cos sin 0 ⎢ ⎥ ⎢ ⎥ θ = θ = R ( ) R ( ) ⎣ ⎦ y ⎢ − θ θ ⎥ 0 0 0 1 ⎣ ⎦ ⎢ θ θ ⎥ 0 0 0 1 x sin 0 cos 0 0 sin cos 0 ⎢ ⎥ ⎢ ⎥ ⎣ ⎦ 0 0 0 1 ⎣ 0 0 0 1 ⎦ Scaling – make an Translation – move θ − θ object bigger/smaller and object ⎡ ⎤ cos sin 0 0 ⎢ ⎥ θ θ sin cos 0 0 ⎢ ⎥ θ = R ( ) z ⎢ ⎥ 0 0 1 0 ⎢ ⎥ ⎣ 0 0 0 1 ⎦ 5
Coordinate Transformations Coordinate Transformation • Individual operations can be composed into • Beware: Transformation is not a single matrix. communitive ⋅ ⋅ ⋅ ≠ ⋅ ⋅ ⋅ = ⋅ ⋅ ⋅ R T S R R S R T M R T S R y x y x y x Coordinate Transformation Object Hierarchy • So how do you transform objects? p – On a point by point basis – Perform transformations (matrix A multiplications) in homogeneous space B – Translate back to Euclidean space using definition: • (x,y,z,w) -> (x/w, y/w, z/w) – Questions? • Wish to rotate wrt p Object Hierarchy Object Hierarchy • T BW = transformation of B wrt world • Most rendering systems / API maintain a transformation matrix stack • T AW = transformation of A wrt world – Push when going into the hierarchy • T BA = transformation of B wrt A = ⋅ – Pop when leaving the hierarchy T T T BW BA AW To rotate about p, change T BA 6
Object Hierarchy Object Hierarchy • Stack of transformation matrices • Object Hierarchy applets Finger wrt hand – http://www.cs.brown.edu/exploratories/freeSoftware/re pository/edu/brown/cs/exploratories/applets/transformat Hand wrt arm ionHierarchy/transformation_hierarchy_guide.html Arm wrt body – http://www.cs.brown.edu/exploratories/freeSoftware/re Body wrt world pository/edu/brown/cs/exploratories/applets/transformP ropagation/transform_propagation_guide.html Specifying the Scene State Machine Model 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. – Scene Graph • Material properties • Inventor • Object transformation matrix • VRML/X3D • Lights / Camera parameters • Java3D – 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 vector. • Rendering • Animation • Some rudimentary and low level interactivity 7
Recommend
More recommend