Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.

Slides:



Advertisements
Similar presentations
Arbitrary Rotations in 3D Lecture 18 Wed, Oct 8, 2003.
Advertisements

Three Dimensional Modeling Transformations
MAE152 Computer Graphicsfor Scientists and Engineers Revision of Matrices Relevance to Graphics.
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Welcome to CSc 830 Advanced Computer Graphics
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
©College of Computer and Information Science, Northeastern UniversityJune 26, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 11.
Course Website: Computer Graphics 3: 2D Transformations.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
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
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
Mathematical Fundamentals
HCT.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
©College of Computer and Information Science, Northeastern UniversitySeptember 9, CS 4300 Computer Graphics Prof. Harriet Fell Fall 2011 Lecture.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformations Dr. Amy Zhang.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Lecture Notes: Computer Graphics.
2003CS Hons RW778 Graphics1 Chapter 5: Transforming Objects 5.2 Introduction to Transformations 5.2 Introduction to Transformations –Affine transformations.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Affine Transformations.
Computer Graphics 3D Transformations. Translation.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
3-D Geometric Transformations
3D Geometric Transformation
3D Geometric Transformation
3-D Transformational Geometry CS418 Computer Graphics John C. Hart.
Transformations: Projection CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Lecture 5: Introduction to 3D
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
3D Coordinate Systems o3D computer graphics involves the additional dimension of depth, allowing more realistic representations of 3D objects in the real.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
3D Geometry and Transformations
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Transforms.
3D Geometric Transformation
Chapter 7 Matrix Mathematics
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
3D Transformation.
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Transformations 3 University of British Columbia
COMP 175: Computer Graphics February 21, 2016
CSCE441: Computer Graphics 2D/3D Transformations
Presentation transcript:

Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003

David Luebke 2 12/23/2015 Admin ● Call roll ● Assn 1 ■ Remember, due Monday 10 AM (ie, don’t skip class) ■ Several people have turned in already – nice job

David Luebke 3 12/23/2015 Recap: Translations ● For convenience we usually describe objects in relation to their own coordinate system ● We can translate or move points to a new position by adding offsets to their coordinates: ■ Note that this translates all points uniformly

David Luebke 4 12/23/2015 Recap: Scaling ● Scaling operation: ● Or, in matrix form: scaling matrix

David Luebke 5 12/23/2015 Recap: 3-D Rotation ● 3x3 matrix for rotation about the z-axis:

David Luebke 6 12/23/2015 Recap: 3-D Rotation ● 3x3 matrix for rotation about the y-axis:

David Luebke 7 12/23/2015 Recap: 3-D Rotation ● 3x3 matrix for rotation about the x-axis:

David Luebke 8 12/23/2015 Recap: Composing Canonical Rotations ● Goal: rotate about arbitrary vector A by  ■ Idea: we know how to rotate about X,Y,Z So, rotate about Y by  until A lies in the YZ plane Then rotate about X by  until A coincides with +Z Then rotate about Z by  Then reverse the rotation about X (by -  ) Then reverse the rotation about Y (by -  )

David Luebke 9 12/23/2015 Composing Canonical Rotations ● First: rotating about Y by  until A lies in YZ ■ Draw it… ● How exactly do we calculate  ? ■ Project A onto XZ plane ■ Find angle  to X:  = -(90° -  ) =  - 90 ° ● Second: rotating about X by  until A lies on Z ● How do we calculate  ?

David Luebke 10 12/23/2015 Composing Canonical Rotations ● Why are we slogging through all this tedium? ● A: Because you’ll have to do it on the test

David Luebke 11 12/23/ D Rotation Matrices ● So an arbitrary rotation about A composites several canonical rotations together ● We can express each rotation as a matrix ● Compositing transforms == multiplying matrices ● Thus we can express the final rotation as the product of canonical rotation matrices ● Thus we can express the final rotation with a single matrix!

David Luebke 12 12/23/2015 Compositing Matrices ● So we have the following matrices: p: The point to be rotated about A by  R y  : Rotate about Y by  R x  : Rotate about X by  R z  : Rotate about Z by  R x  -1 : Undo rotation about X by  R y  -1 : Undo rotation about Y by  ● In what order should we multiply them?

David Luebke 13 12/23/2015 Compositing Matrices ● Remember: the transformations, in order, are written from right to left ■ In other words, the first matrix to affect the vector goes next to the vector, the second next to the first, etc. ■ This is the rule with column vectors (OpenGL); row vectors would be the opposite ● So in our case: p’ = R y  -1 R x  -1 R z  R x  R y  p

David Luebke 14 12/23/2015 Rotation Matrices ● Notice these two matrices: R x  : Rotate about X by  R x  -1 : Undo rotation about X by  ● How can we calculate R x  -1 ? ■ Obvious answer: calculate R x (-  ) ■ Clever answer: exploit fact that rotation matrices are orthogonal ● What is an orthogonal matrix? ● What property are we talking about?

David Luebke 15 12/23/2015 Rotation Matrices ● Rotation matrix is orthogonal ■ Columns/rows linearly independent ■ Columns/rows sum to 1 ● The inverse of an orthogonal matrix is just its transpose:

David Luebke 16 12/23/2015 Translation Matrices? ● We can composite scale matrices just as we did rotation matrices ● But how to represent translation as a matrix? ● Answer: with homogeneous coordinates

David Luebke 17 12/23/2015 Homogeneous Coordinates ● Homogeneous coordinates: represent coordinates in 3 dimensions with a 4-vector (Note that typically w = 1 in object coordinates)

David Luebke 18 12/23/2015 Homogeneous Coordinates ● Homogeneous coordinates seem unintuitive, but they make graphics operations much easier ● Our transformation matrices are now 4x4:

David Luebke 19 12/23/2015 Homogeneous Coordinates ● Homogeneous coordinates seem unintuitive, but they make graphics operations much easier ● Our transformation matrices are now 4x4:

David Luebke 20 12/23/2015 Homogeneous Coordinates ● Homogeneous coordinates seem unintuitive, but they make graphics operations much easier ● Our transformation matrices are now 4x4:

David Luebke 21 12/23/2015 Homogeneous Coordinates ● Homogeneous coordinates seem unintuitive, but they make graphics operations much easier ● Our transformation matrices are now 4x4:

David Luebke 22 12/23/2015 Homogeneous Coordinates ● How can we represent translation as a 4x4 matrix? ● A: Using the rightmost column:

David Luebke 23 12/23/2015 Translation Matrices ● Now that we can represent translation as a matrix, we can composite it with other transformations ● Ex: rotate 90° about X, then 10 units down Z:

David Luebke 24 12/23/2015 Translation Matrices ● Now that we can represent translation as a matrix, we can composite it with other transformations ● Ex: rotate 90° about X, then 10 units down Z:

David Luebke 25 12/23/2015 Translation Matrices ● Now that we can represent translation as a matrix, we can composite it with other transformations ● Ex: rotate 90° about X, then 10 units down Z:

David Luebke 26 12/23/2015 Translation Matrices ● Now that we can represent translation as a matrix, we can composite it with other transformations ● Ex: rotate 90° about X, then 10 units down Z:

David Luebke 27 12/23/2015 Transformation Commutativity ● Is matrix multiplication, in general, commutative? Does AB = BA? ● What about rotation, scaling, and translation matrices? ■ Does R x R y = R y R x ? ■ Does R A S = SR A ? ■ Does R A T = TR A ?