DOC PREVIEW
OSU CS 419 - Transformations

This preview shows page 1-2-3-4-5 out of 14 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 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 14 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 14 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 14 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 14 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1TransformationsMike [email protected]@ gOregon State Universitymjb – September 5, 2014Oregon State UniversityComputer GraphicsGeometry vs. Topology134Original Object12312341234Geometry = changedTopolog same (12341)mjb – September 5, 2014Oregon State UniversityComputer GraphicsWhere things are (e.g., coordinates)Geometry:How things are connectedTopology:2Topology = same (1-2-3-4-1)Geometry = sameTopology = changed (1-2-4-3-1)23D Coordinate SystemsYYXXZmjb – September 5, 2014Oregon State UniversityComputer GraphicsRight-HandedZLeft-HandedTransformationsYSuppose you have a point P and you want to move it over by 2 units in X – how would you hP’ dit?Xchange P’s coordinates?P P’(,)( 2.,)PPP P Pmjb – September 5, 2014Oregon State UniversityComputer Graphics(,)( 2.,)xyx yPPP P PThis is known as a coordinate transformation3General Form of 3D Linear TransformationsxAxByCzDyExFyGzHz IxJyKzL It’s called a “Linear Transformation” because all of the coordinates are raised to the 1stpower, that is, there are no x2, x3, etc. terms.mjb – September 5, 2014Oregon State UniversityComputer GraphicsTransform the geometry – leave the topology as isTranslation EquationsxxxTxyyyTzzzTyTmjb – September 5, 2014Oregon State UniversityComputer GraphicsxT4Scaling About the OriginxxS xxxSyyyS zzzS mjb – September 5, 2014Oregon State UniversityComputer Graphics2D Rotation About the Originicos sinxxysin cosyx ymjb – September 5, 2014Oregon State UniversityComputer Graphics5Linear Equations in Matrix FormxAx By Cz Dx consuming columnyExFyGzHzIxJyKzL xABCD xyEFGHy    x’ producing rowy consuming columnz consuming columnconstant column’dimjb – September 5, 2014Oregon State UniversityComputer Graphics100011yEFGHyzIJKLz     y’ producing rowz’ producing rowIdentity Matrix ( [ I ] )100001000010xxyyzz   xxyyzzmjb – September 5, 2014Oregon State UniversityComputer Graphics[ I ] signifies that “Nothing has changed”0010100011zz   6Matrix Inverse[M]•[M]-1= [I][][][][M]•[M]-1= “Nothing has changed”mjb – September 5, 2014Oregon State UniversityComputer Graphics“Whatever [M] does, [M]-1undoes”Translation Matrix100010001xyxTxyTyT    mjb – September 5, 2014Oregon State UniversityComputer Graphics001100011zzTz   Quick! What is the inverse of this matrix?7Scaling Matrix00000000 0xyxSxySyzSz   mjb – September 5, 2014Oregon State UniversityComputer Graphics00 0100011zzSz  Quick! What is the inverse of this matrix?3D Rotation Matrix About ZRight-handed coordinatesYRight-handed positive rotation rule+90º rotation gives: y’ = xXYmjb – September 5, 2014Oregon State UniversityComputer Graphicscos sin 0 0sin cos 0 00010100011xxyyzz    Z83D Rotation Matrix About YYX+90º rotation gives: x’ = zmjb – September 5, 2014Oregon State UniversityComputer GraphicsZcos 0 sin 00100sin 0 cos 0100011xxyyzz    3D Rotation Matrix About XY+90º rotation gives: z’ = yXmjb – September 5, 2014Oregon State UniversityComputer GraphicsZ10 0 00cos sin 00sin cos 0100 011xxyyzz    9How it Really Works :-)http://xkcd.commjb – September 5, 2014Oregon State UniversityComputer GraphicsCompound TransformationsBBYQ: Our rotation matrices only work around the origin? What if we want to rotate about an arbitrary point (A,B)?AUth tiAAWrite itXxx  A: Use more than one matrix.123mjb – September 5, 2014Oregon State UniversityComputer GraphicsSay it,,11AB AByyTRTzz        10Matrix Multiplication is not CommutativeYYXRotate, then translateYXmjb – September 5, 2014Oregon State UniversityComputer GraphicsTranslate, then rotateXMatrix Multiplication is AssociativeAB ABxxyyTRT      ,,11AB ABzz     xxyy   mjb – September 5, 2014Oregon State UniversityComputer Graphics,,11AB AByyTRTzz       One matrix –the Current Transformation Matrix, or CTM}11Can Multiply All Geometry by One Matrix !BBYAAX[]xxyyzzM     mjb – September 5, 2014Oregon State UniversityComputer GraphicsGraphics hardware can do this very quickly!11  OpenGL Will Do the Transformation Compounding for You !glTranslatef( A, B, C );glRotatef( (GLfloat)Yrot, 0., 1., 0. );glRotatef( (GLfloat)Xrot, 1., 0., 0. );glScalef( (GLfloat)Scale, (GLfloat)Scale, (GLfloat)Scale );oat)Scale );g((),(),());glCallList( BoxList );C );at)Yrot, 0., 1.,


View Full Document

OSU CS 419 - Transformations

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?