Luo Jr. CSCI-45/65 Advanced Computer Graphics http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/s9/ Barb Cutler cutler@cs.rpi.edu MRC 9A Piar Animation Studios, 986 Topics for the Semester Mesh Simplification Meshes representation simplification subdivision surfaces generation volumetric modeling Simulation particle sstems rigid bod, deformation, cloth, wind/water flows collision detection weathering Rendering ra tracing appearance models shadows local vs. global illumination radiosit, photon mapping, subsurface scattering, etc. procedural modeling teture snthesis hardware & more Hoppe Progressive Meshes SIGGRAPH 996 4 Mesh Generation & Volumetric Modeling Modeling Subdivision Surfaces Hoppe et al., Piecewise Smooth Surface Reconstruction 994 Cutler et al., Simplification and Improvement of Geri s Game Piar 997 Tetrahedral Models for Simulation 4 5 6
Particle Sstems Phsical Simulation Star Trek: The Wrath of Khan 98 7 Fluid Dnamics Rigid Bod Dnamics Collision Detection Fracture Deformation Müller et al., Stable Real-Time Deformations 8 Ra Casting For ever piel construct a ra from the ee For ever object in the scene Find intersection with the ra Keep the closest Foster & Mataas, 996 Visual Simulation of Smoke Fedkiw, Stam & Jensen SIGGRAPH 9 Ra Tracing Shade (interaction of light and material) Secondar ras (shadows, reflection, refraction) Subsurface Scattering An Improved Illumination Model for Shaded Displa Whitted 98 Jensen et al., A Practical Model for Subsurface Light Transport Surface
Appearance Models Sllabus & Course Website http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/ S9/ Which version should I register for? CSCI 65 Wojciech Matusik units of graduate credit CSCI 45 θr θi 4 units of undergraduate credit same lectures, assignments, quies, & grading criteria φi φr Other Questions? Henrik Wann Jensen 4 Introductions Who are ou? name ear/degree graphics background (if an) research/job interests wh ou are taking this class something fun, interesting, or unusual about ourself Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics 5 6 Simple Transformations What is a Transformation? Maps points (, ) in one coordinate sstem to points (', ') in another coordinate sstem ' a + b + c ' d + e + f For eample, Iterated Function Sstem (IFS): Can be combined Are these operations invertible? Yes, ecept scale 7 8
Transformations are used to: Position objects in a scene Change the shape of objects Create multiple copies of objects Projection for virtual cameras Describe animations Rigid-Bod / Euclidean Transforms Preserves distances Preserves angles Identit 9 Similitudes / Similarit Transforms Linear Transformations Preserves angles Similitudes Similitudes Linear Identit Isotropic Scaling Identit Isotropic Scaling Scaling Reflection Shear Linear Transformations Affine Transformations L(p + q) L(p) + L(q) L(ap) a L(p) preserves parallel lines Affine Similitudes Linear Similitudes Linear Identit Isotropic Scaling Scaling Reflection Shear Identit Isotropic Scaling Scaling Reflection Shear 4 4
Projective Transformations General (Free-Form) Transformation preserves lines Does not preserve lines Not as pervasive, computationall more involved Projective Affine Similitudes Linear Scaling Identit Isotropic Scaling Reflection Shear Perspective Sederberg and Parr, Siggraph 986 5 6 How are Transforms Represented? Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics ' a + b + c ' d + e + f ' a ' d b e p' Mp c + f + t 7 Homogeneous Coordinates 8 in homogeneous coordinates ' a + b + c ' d + e + f Add an etra dimension in D, we use matrices In D, we use 4 4 matrices Affine formulation Each point has an etra value, w a ' e ' i ' m w' p' b c d f g h j k l n o p Mp w 9 ' a ' d b e p' Mp Homogeneous formulation c + f + t ' a b c ' d e f p' Mp 5
Homogeneous Coordinates Most of the time w, and we can ignore it ' ' ' a e i b f j c g k d h l Homogeneous Visualiation Divide b w to normalie (homogenie) W? Point at infinit (direction) If we multipl a homogeneous coordinate b an affine matri, w is unchanged (,, ) (,, ) (7,, ) (4,, ) (4, 5, ) (8,, ) w w Translate (t, t, t) Translate(c,,) Scale (s, s, s) Scale(s,s,s) p' Wh bother with the etra dimension? Because now translations can be encoded in the matri! p c p' Isotropic (uniform) scaling: s s s p q q' ' ' ' t t t ' ' ' s s s 4 About ais ZRotate(θ) θ p' p About (k, k, k), a unit vector on an arbitrar ais (Rodrigues Formula) Rotate(k, θ) θ k ' ' ' cos θ sin θ -sin θ cos θ ' ' ' kk(-c)+c kk(-c)+ks kk(-c)-ks kk(-c)-ks kk(-c)+c kk(-c)-ks kk(-c) +ks kk(-c)-ks kk(-c)+c where c cos θ & s sin θ 5 6 6
Storage Often, w is not stored (alwas ) Needs careful handling of direction vs. point Mathematicall, the simplest is to encode directions with w In terms of storage, using a -component arra for both direction and points is more efficient Which requires to have special operation routines for points vs. directions Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics 7 8 How are transforms combined? Scale then Translate Non-commutative Composition Scale then Translate: p' T ( S p ) TS p (,) (,) Scale(,) (,) (,) Translate(,) (,) (5,) (,) (,) Scale(,) (,) (,) Translate(,) (,) (5,) Use matri multiplication: p' T ( S p ) TS p TS Caution: matri multiplication is NOT commutative! 9 Translate then Scale: p' S ( T p ) ST p Translate(,) (4,) Scale(,) (,) (6,) (,) (,) (8,4) 4 Non-commutative Composition Scale then Translate: p' T ( S p ) TS p TS Translate then Scale: p' S ( T p ) ST p ST 6 Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics 4 4 7
Orthographic vs. Perspective Orthographic Simple Orthographic Projection Project all points along the ais to the plane Perspective 4 44 Simple Perspective Projection Project all points along the ais to the d plane, eepoint at the origin: Alternate Perspective Projection Project all points along the ais to the plane, eepoint at the (,,-d): homogenie homogenie * d / * d / d / d /d 45 * d / ( + d) * d / ( + d) ( + d)/ d /d 46 In the limit, as d this perspective projection matri... /d...is simpl an orthographic projection Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics 47 48 8
Iterated Function Sstems (IFS) Eample: Sierpinski Triangle Capture self-similarit Contraction (reduce distances) An attractor is a fied point Described b a set of n affine transformations In this case, n translate & scale b.5 49 Eample: Sierpinski Triangle 5 Another IFS: The Dragon for lots of random input points (, ) for j to num_iters randoml pick one of the transformations (k+, k+) fi (k, k) displa (k, k) Increasing the number of iterations 5 5 D IFS in OpenGL Assignment : OpenGL Warmup GL_POINTS Get familiar with: GL_QUADS C++ environment OpenGL Transformations simple Vector & Matri classes Have Fun! Will not be graded (but ou should still do it and submit it!) 5 54 9
OpenGL Basics: GL_POINTS Course Overview Classes of Transformations Representing Transformations Combining Transformations Orthographic & Perspective Projections Eample: Iterated Function Sstems (IFS) OpenGL Basics gldisable(gl_lighting); glbegin(gl_points); glcolorf(.,.,.); glvertef( ); glend(); lighting should be disabled... 55 OpenGL Basics: GL_QUADS 56 OpenGL Basics: Transformations Useful commands: glenable(gl_lighting); glbegin(gl_quads); glnormalf( ); glcolorf(.,.,.); glvertef( ); glvertef( ); glvertef( ); glvertef( ); glend(); glmatrimode(gl_modelview); glpushmatri(); glpopmatri(); glmultmatrif( ); lighting should be enabled... an appropriate normal should be specified From OpenGL Reference Manual 57 Questions? 58 For Net Time: Read Hugues Hoppe Progressive Meshes SIGGRAPH 996 Post a comment or question on the course WebCT/LMS discussion b am on Frida /5 Image b Henrik Wann Jensen 59 6