DOC PREVIEW
UVA CS 445 - Transformations

This preview shows page 1-2-3-20-21-40-41-42 out of 42 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1AdminDemoTranslationsScalingSlide 6Slide 72-D RotationSlide 93-D RotationSlide 11Slide 12Slide 13Composing Canonical RotationsSlide 153-D Rotation MatricesCompositing MatricesSlide 18Rotation MatricesSlide 20Translation Matrices?Homogeneous CoordinatesSlide 23Slide 24Slide 25Slide 26Slide 27Translation MatricesSlide 29Slide 30Slide 31Transformation CommutativityMore On Homogeneous CoordsSlide 34Perspective ProjectionSlide 36Slide 37Slide 38A Perspective Projection MatrixSlide 40Slide 41Projection MatricesCS 445: Introduction to Computer GraphicsDavid LuebkeUniversity of VirginiaTransformationsAdminCall rollForums signup – do it NOW pleaseDemoAnimusicTranslations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zyxtttzyxzyx'''ScalingScaling a coordinate means multiplying each of its components by a scalarUniform scaling means this scalar is the same for all components: 2ScalingNon-uniform scaling: different scalars per component:How can we represent this in matrix form?X  2,Y  0.5ScalingScaling operation:Or, in matrix form:czbyaxzyx'''zyxcbazyx000000'''scaling matrix2-D Rotation(x, y)(x’, y’)x’ = x cos () - y sin()y’ = x sin() + y cos()2-D RotationThis is easy to capture in matrix form:3-D is more complicated–Need to specify an axis of rotation–Simple cases: rotation about X, Y, Z axes      yxyxcossinsincos''3-D RotationWhat does the 3-D rotation matrix look like for a rotation about the Z-axis?–Build it coordinate-by-coordinatezyxzyx1000)cos()sin(0)sin()cos('''3-D RotationWhat does the 3-D rotation matrix look like for a rotation about the Y-axis?–Build it coordinate-by-coordinatezyxzyx)cos(0)sin(010)sin(0)cos('''3-D RotationWhat does the 3-D rotation matrix look like for a rotation about the X-axis?–Build it coordinate-by-coordinatezyxzyx)cos()sin(0)sin()cos(0001'''3-D RotationGeneral rotations in 3-D require rotating about an arbitrary axis of rotationDeriving the rotation matrix for such a rotation directly is a good exercise in linear algebraAnother approach: express general rotation as composition of canonical rotations –Rotations about X, Y, ZComposing Canonical RotationsGoal: rotate about arbitrary vector A by  –Idea: we know how to rotate about X,Y,ZSo, rotate about Y by  until A lies in the YZ planeThen rotate about X by  until A coincides with +ZThen rotate about Z by Then reverse the rotation about X (by -)Then reverse the rotation about Y (by -)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 ?3-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!Compositing MatricesSo we have the following matrices:p: The point to be rotated about A by Ry : Rotate about Y by Rx  : Rotate about X by Rz : Rotate about Z by Rx  -1: Undo rotation about X by Ry-1 : Undo rotation about Y by In what order should we multiply them?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’ = Ry-1 Rx  -1 Rz Rx  Ry pRotation MatricesNotice these two matrices:Rx  : Rotate about X by Rx  -1: Undo rotation about X by How can we calculate Rx  -1?–Obvious answer: calculate Rx (-) –Clever answer: exploit fact that rotation matrices are orthonormal What is an orthonormal matrix?What property are we talking about?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:jfciebhdajihfedcbajihfedcbaT1Translation Matrices?We can composite scale matrices just as we did rotation matricesBut how to represent translation as a matrix?Answer: with homogeneous coordinatesHomogeneous CoordinatesHomogeneous coordinates: represent coordinates in 3 dimensions with a 4-vector–[x, y, z, 0]T represents a point at infinity (use for vectors)–[0, 0, 0]T is not allowed–Note that typically w = 1 in object coordinateswzyxwzwywxzyx1///),,(Homogeneous CoordinatesHomogeneous coordinates seem unintuitive, but they make graphics operations much easierOur transformation matrices are now 4x4:10000)cos()sin(00)sin()cos(00001xRHomogeneous CoordinatesHomogeneous coordinates seem unintuitive, but they make graphics operations much easierOur transformation matrices are now 4x4:10000)cos(0)sin(00100)sin(0)cos(yRHomogeneous CoordinatesHomogeneous coordinates seem unintuitive, but they make graphics operations much easierOur transformation matrices are now


View Full Document

UVA CS 445 - Transformations

Documents in this Course
Lighting

Lighting

49 pages

Color

Color

20 pages

Clipping

Clipping

10 pages

Shadows

Shadows

95 pages

Color

Color

37 pages

Radiosity

Radiosity

49 pages

Clipping

Clipping

59 pages

Assign 3

Assign 3

28 pages

Splines

Splines

17 pages

Color

Color

17 pages

Load more
Download Transformations
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Transformations and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Transformations 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?