Introduction to Computer Graphics CS 445 / 645 Lecture 5 Transformations Transformations M.C. Escher – Smaller and Smaller (1956)

Slides:



Advertisements
Similar presentations
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Advertisements

Computer Graphics Lecture 4 Geometry & Transformations.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Geometric Transformations
Two-Dimensional Geometric Transformations
Transformations II Week 2, Wed Jan 17
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation.
Graphics-1 Gentle Introduction to Computer Graphics (2) Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Image warping/morphing Digital Video Special Effects Fall /10/17 with slides by Y.Y. Chuang,Richard Szeliski, Steve Seitz and Alexei Efros.
Geometric Transformation-2D
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/27/11 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
CS 450: Computer Graphics 2D TRANSFORMATIONS
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Image Warping (Szeliski 3.6.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Slides from Alexei Efros and Steve Seitz
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Multimedia Programming 06: Image Warping Departments of Digital Contents Sang Il Park.
Warping CSE 590 Computational Photography Tamara Berg.
CS 445 / 645 Introduction to Computer Graphics Lecture 3 Mathematical Primitives Introduction to Transformations Lecture 3 Mathematical Primitives Introduction.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/24/15 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Graphics Graphics Korea University cgvr.korea.ac.kr 2D Geometric Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Lecture Notes: Computer Graphics.
Geometric Transforms Changing coordinate systems.
ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering.
CGPage: 1 東吳資訊科學 江清水 3.1 2D Geometry - points and polygons X Y A point in 2D is represented by two real numbers (X,Y) A line segment is represented by.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/23/10 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Geometric Objects and Transformation
Advanced Multimedia Warping & Morphing Tamara Berg.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Affine Transformations.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Multimedia Programming 07: Image Warping Keyframe Animation Departments of Digital Contents Sang Il Park.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Recap from Monday DCT and JPEG Point Processing Histogram Normalization Questions: JPEG compression levels Gamma correction.
Image Warping Many slides from Alyosha Efros + Steve Seitz + Derek oeim Photo by Sean Carroll.
Computer Graphics I, Fall 2010 Transformations.
CS559: Computer Graphics Lecture 7: Image Warping and Panorama Li Zhang Spring 2008 Most slides borrowed from Yungyu ChuangYungyu Chuang.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Image Warping 2D Geometric Transformations
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Computer Graphics Lecture 15 Fasih ur Rehman. Last Class Combining Transformations Affine versus Rigid body Transformations Homogenous Transformations.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
3. Transformation
Computer Graphics Transformations.
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Image Warping (Szeliski Sec 2.1.2)
Image Warping (Szeliski Sec 2.1.2)
Image Warping : Computational Photography
COMP 175: Computer Graphics February 9, 2016
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
Transformations 3 University of British Columbia
Image Warping : Computational Photography
Image Warping (Szeliski Sec 2.1.2)
Transformations 2 University of British Columbia
Presentation transcript:

Introduction to Computer Graphics CS 445 / 645 Lecture 5 Transformations Transformations M.C. Escher – Smaller and Smaller (1956)

Modeling Transformations Specify transformations for objects Allows definitions of objects in own coordinate systemsAllows definitions of objects in own coordinate systems Allows use of object definition multiple times in a sceneAllows use of object definition multiple times in a scene –Remember how OpenGL provides a transformation stack because they are so frequently reused Chapter 5 from Hearn and Baker Specify transformations for objects Allows definitions of objects in own coordinate systemsAllows definitions of objects in own coordinate systems Allows use of object definition multiple times in a sceneAllows use of object definition multiple times in a scene –Remember how OpenGL provides a transformation stack because they are so frequently reused Chapter 5 from Hearn and Baker H&B Figure 109

Overview 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D

2D Modeling Transformations Scale Rotate Translate Scale Translate x y World Coordinates Modeling Coordinates

2D Modeling Transformations x y World Coordinates Modeling Coordinates Let’s look at this in detail…

2D Modeling Transformations x y Modeling Coordinates Initial location at (0, 0) with x- and y-axes aligned

2D Modeling Transformations x y Modeling Coordinates Scale.3,.3 Rotate -90 Translate 5, 3

2D Modeling Transformations x y Modeling Coordinates Scale.3,.3 Rotate -90 Translate 5, 3

2D Modeling Transformations x y Modeling Coordinates Scale.3,.3 Rotate -90 Translate 5, 3 World Coordinates

Scaling Scaling a coordinate means multiplying each of its components by a scalar Uniform scaling means this scalar is the same for all components: Scaling a coordinate means multiplying each of its components by a scalar Uniform scaling means this scalar is the same for all components:  2 2

Non-uniform scaling: different scalars per component: How can we represent this in matrix form? Non-uniform scaling: different scalars per component: How can we represent this in matrix form? Scaling X  2, Y  0.5

Scaling Scaling operation: Or, in matrix form: Scaling operation: Or, in matrix form: scaling matrix

2-D Rotation  (x, y) (x’, y’) x’ = x cos(  ) - y sin(  ) y’ = x sin(  ) + y cos(  )

2-D Rotation x = r cos (  ) y = r sin (  ) x’ = r cos (  +  ) y’ = r sin (  +  ) Trig Identity… x’ = r cos(  ) cos(  ) – r sin(  ) sin(  ) y’ = r sin(  ) sin(  ) + r cos(  ) cos(  ) Substitute… x’ = x cos(  ) - y sin(  ) y’ = x sin(  ) + y cos(  )  (x, y) (x’, y’) 

2-D Rotation This is easy to capture in matrix form: Even though sin(  ) and cos(  ) are nonlinear functions of , x’ is a linear combination of x and yx’ is a linear combination of x and y y’ is a linear combination of x and yy’ is a linear combination of x and y This is easy to capture in matrix form: Even though sin(  ) and cos(  ) are nonlinear functions of , x’ is a linear combination of x and yx’ is a linear combination of x and y y’ is a linear combination of x and yy’ is a linear combination of x and y

Basic 2D Transformations Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos  Transformations can be combined (with simple algebra)

Basic 2D Transformations Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos 

Basic 2D Transformations Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos  x’ = x*s x y’ = y*s y x’ = x*s x y’ = y*s y (x,y) (x’,y’)

Basic 2D Transformations x’ = (x*s x )*cos  - (y*s y )*sin  y’ = (x*s x )*sin  + (y*s y )*cos  x’ = (x*s x )*cos  - (y*s y )*sin  y’ = (x*s x )*sin  + (y*s y )*cos  (x’,y’) Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos 

Basic 2D Transformations Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos  x’ = ((x*s x )*cos  - (y*s y )*sin  ) + t x y’ = ((x*s x )*sin  + (y*s y )*cos  ) + t y x’ = ((x*s x )*cos  - (y*s y )*sin  ) + t x y’ = ((x*s x )*sin  + (y*s y )*cos  ) + t y (x’,y’)

Basic 2D Transformations Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos Translation: x’ = x + t xx’ = x + t x y’ = y + t yy’ = y + t yScale: x’ = x * s xx’ = x * s x y’ = y * s yy’ = y * s yShear: x’ = x + h x *yx’ = x + h x *y y’ = y + h y *xy’ = y + h y *xRotation: x’ = x*cos  - y*sin x’ = x*cos  - y*sin  y’ = x*sin  + y*cos y’ = x*sin  + y*cos  x’ = ((x*s x )*cos  - (y*s y )*sin  ) + t x y’ = ((x*s x )*sin  + (y*s y )*cos  ) + t y x’ = ((x*s x )*cos  - (y*s y )*sin  ) + t x y’ = ((x*s x )*sin  + (y*s y )*cos  ) + t y

Overview 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D

Matrix Representation Represent 2D transformation by a matrix Multiply matrix by column vector  apply transformation to point Represent 2D transformation by a matrix Multiply matrix by column vector  apply transformation to point

Matrix Representation Transformations combined by multiplication Matrices are a convenient and efficient way to represent a sequence of transformations!

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Identity? 2D Scale around (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Rotate around (0,0)? 2D Shear?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Mirror about Y axis? 2D Mirror over (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Translation? Only linear 2D transformations can be represented with a 2x2 matrix NO!

Linear Transformations Linear transformations are combinations of … Scale,Scale, Rotation,Rotation, Shear, andShear, and MirrorMirror Properties of linear transformations: Satisfies:Satisfies: Origin maps to originOrigin maps to origin Lines map to linesLines map to lines Parallel lines remain parallelParallel lines remain parallel Ratios are preservedRatios are preserved Closed under compositionClosed under composition Linear transformations are combinations of … Scale,Scale, Rotation,Rotation, Shear, andShear, and MirrorMirror Properties of linear transformations: Satisfies:Satisfies: Origin maps to originOrigin maps to origin Lines map to linesLines map to lines Parallel lines remain parallelParallel lines remain parallel Ratios are preservedRatios are preserved Closed under compositionClosed under composition

Homogeneous Coordinates Q: How can we represent translation as a 3x3 matrix?

Homogeneous Coordinates Homogeneous coordinates represent coordinates in 2 dimensions with a 3-vectorrepresent coordinates in 2 dimensions with a 3-vector Homogeneous coordinates represent coordinates in 2 dimensions with a 3-vectorrepresent coordinates in 2 dimensions with a 3-vector Homogeneous coordinates seem unintuitive, but they make graphics operations much easier

Homogeneous Coordinates Q: How can we represent translation as a 3x3 matrix? A: Using the rightmost column: Q: How can we represent translation as a 3x3 matrix? A: Using the rightmost column:

Translation Example of translation   t x = 2 t y = 1 Homogeneous Coordinates

Add a 3rd coordinate to every 2D point (x, y, w) represents a point at location (x/w, y/w)(x, y, w) represents a point at location (x/w, y/w) (x, y, 0) represents a point at infinity(x, y, 0) represents a point at infinity (0, 0, 0) is not allowed(0, 0, 0) is not allowed Add a 3rd coordinate to every 2D point (x, y, w) represents a point at location (x/w, y/w)(x, y, w) represents a point at location (x/w, y/w) (x, y, 0) represents a point at infinity(x, y, 0) represents a point at infinity (0, 0, 0) is not allowed(0, 0, 0) is not allowed Convenient coordinate system to represent many useful transformations (2,1,1) or (4,2,2)or (6,3,3) x y

Basic 2D Transformations Basic 2D transformations as 3x3 matrices Translate RotateShear Scale

Affine Transformations Affine transformations are combinations of … Linear transformations, andLinear transformations, and TranslationsTranslations Properties of affine transformations: Origin does not necessarily map to originOrigin does not necessarily map to origin Lines map to linesLines map to lines Parallel lines remain parallelParallel lines remain parallel Ratios are preservedRatios are preserved Closed under compositionClosed under composition Affine transformations are combinations of … Linear transformations, andLinear transformations, and TranslationsTranslations Properties of affine transformations: Origin does not necessarily map to originOrigin does not necessarily map to origin Lines map to linesLines map to lines Parallel lines remain parallelParallel lines remain parallel Ratios are preservedRatios are preserved Closed under compositionClosed under composition

Projective Transformations Projective transformations … Affine transformations, andAffine transformations, and Projective warpsProjective warps Properties of projective transformations: Origin does not necessarily map to originOrigin does not necessarily map to origin Lines map to linesLines map to lines Parallel lines do not necessarily remain parallelParallel lines do not necessarily remain parallel Ratios are not preservedRatios are not preserved Closed under compositionClosed under composition Projective transformations … Affine transformations, andAffine transformations, and Projective warpsProjective warps Properties of projective transformations: Origin does not necessarily map to originOrigin does not necessarily map to origin Lines map to linesLines map to lines Parallel lines do not necessarily remain parallelParallel lines do not necessarily remain parallel Ratios are not preservedRatios are not preserved Closed under compositionClosed under composition

Overview 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D

Matrix Composition Transformations can be combined by matrix multiplication p’ = T(t x,t y ) R(  ) S(s x,s y ) p

Matrix Composition Matrices are a convenient and efficient way to represent a sequence of transformations General purpose representationGeneral purpose representation Hardware matrix multiplyHardware matrix multiply Matrices are a convenient and efficient way to represent a sequence of transformations General purpose representationGeneral purpose representation Hardware matrix multiplyHardware matrix multiply p’ = (T * (R * (S*p) ) ) p’ = (T*R*S) * p

Matrix Composition Be aware: order of transformations matters –Matrix multiplication is not commutative Be aware: order of transformations matters –Matrix multiplication is not commutative p’ = T * R * S * p “Global”“Local”

Matrix Composition What if we want to rotate and translate? Ex: Rotate line segment by 45 degrees about endpoint a and lengthenEx: Rotate line segment by 45 degrees about endpoint a and lengthen What if we want to rotate and translate? Ex: Rotate line segment by 45 degrees about endpoint a and lengthenEx: Rotate line segment by 45 degrees about endpoint a and lengthen aa

Multiplication Order – Wrong Way Our line is defined by two endpoints Applying a rotation of 45 degrees, R(45), affects both pointsApplying a rotation of 45 degrees, R(45), affects both points We could try to translate both endpoints to return endpoint a to its original position, but by how much?We could try to translate both endpoints to return endpoint a to its original position, but by how much? Our line is defined by two endpoints Applying a rotation of 45 degrees, R(45), affects both pointsApplying a rotation of 45 degrees, R(45), affects both points We could try to translate both endpoints to return endpoint a to its original position, but by how much?We could try to translate both endpoints to return endpoint a to its original position, but by how much? WrongCorrect T(-3) R(45) T(3) R(45) a a a

Multiplication Order - Correct Isolate endpoint a from rotation effects First translate line so a is at origin: T (-3)First translate line so a is at origin: T (-3) Then rotate line 45 degrees: R(45)Then rotate line 45 degrees: R(45) Then translate back so a is where it was: T(3)Then translate back so a is where it was: T(3) Isolate endpoint a from rotation effects First translate line so a is at origin: T (-3)First translate line so a is at origin: T (-3) Then rotate line 45 degrees: R(45)Then rotate line 45 degrees: R(45) Then translate back so a is where it was: T(3)Then translate back so a is where it was: T(3) a a a a

Will this sequence of operations work? Matrix Composition

After correctly ordering the matrices Multiply matrices together What results is one matrix – store it (on stack)! Multiply this matrix by the vector of each vertex All vertices easily transformed with one matrix multiply After correctly ordering the matrices Multiply matrices together What results is one matrix – store it (on stack)! Multiply this matrix by the vector of each vertex All vertices easily transformed with one matrix multiply

Overview 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D 2D Transformations Basic 2D transformationsBasic 2D transformations Matrix representationMatrix representation Matrix compositionMatrix composition 3D Transformations Basic 3D transformationsBasic 3D transformations Same as 2DSame as 2D

3D Transformations Same idea as 2D transformations Homogeneous coordinates: (x,y,z,w)Homogeneous coordinates: (x,y,z,w) 4x4 transformation matrices4x4 transformation matrices Same idea as 2D transformations Homogeneous coordinates: (x,y,z,w)Homogeneous coordinates: (x,y,z,w) 4x4 transformation matrices4x4 transformation matrices

Basic 3D Transformations IdentityScale TranslationMirror about Y/Z plane

Basic 3D Transformations Rotate around Z axis: Rotate around Y axis: Rotate around X axis:

Reverse Rotations Q: How do you undo a rotation of  R(  )? A: Apply the inverse of the rotation… R -1 (  ) = R(-  ) How to construct R-1(  ) = R(-  ) Inside the rotation matrix: cos(  ) = cos(-  )Inside the rotation matrix: cos(  ) = cos(-  ) –The cosine elements of the inverse rotation matrix are unchanged The sign of the sine elements will flipThe sign of the sine elements will flip Therefore… R -1 (  ) = R(-  ) = R T (  ) Q: How do you undo a rotation of  R(  )? A: Apply the inverse of the rotation… R -1 (  ) = R(-  ) How to construct R-1(  ) = R(-  ) Inside the rotation matrix: cos(  ) = cos(-  )Inside the rotation matrix: cos(  ) = cos(-  ) –The cosine elements of the inverse rotation matrix are unchanged The sign of the sine elements will flipThe sign of the sine elements will flip Therefore… R -1 (  ) = R(-  ) = R T (  )

Summary Coordinate systems World vs. modeling coordinatesWorld vs. modeling coordinates 2-D and 3-D transformations Trigonometry and geometryTrigonometry and geometry Matrix representationsMatrix representations Linear vs. affine transformationsLinear vs. affine transformations Matrix operations Matrix compositionMatrix composition Coordinate systems World vs. modeling coordinatesWorld vs. modeling coordinates 2-D and 3-D transformations Trigonometry and geometryTrigonometry and geometry Matrix representationsMatrix representations Linear vs. affine transformationsLinear vs. affine transformations Matrix operations Matrix compositionMatrix composition