DOC PREVIEW
OSU CS 419 - Transformations

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

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

Unformatted text preview:

1TransformationsMike [email protected] State Universitymjb – September 5, 2014Oregon State UniversityComputer GraphicsGeometry vs. Topology1234434Original Objectmjb – September 5, 2014Oregon State UniversityComputer GraphicsWhere things are (e.g., coordinates)Geometry:How things are connectedTopology:123123Geometry = changedTopology = same (1-2-3-4-1)Geometry = sameTopology = changed (1-2-4-3-1)3D Coordinate SystemsYYZmjb – September 5, 2014Oregon State UniversityComputer GraphicsRight-HandedXZXLeft-HandedTransformationsYSuppose you have a point P and you want to move it over by 2 units in X – how would you change P’s coordinates?P P’mjb – September 5, 2014Oregon State UniversityComputer GraphicsX(,)( 2., )xyx yPPP P PThis is known as a coordinate transformationGeneral Form of 3D Linear TransformationsxAx By Cz DyExFyGzH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 isz IxJyKzL Translation EquationsxxxTyyyTmjb – September 5, 2014Oregon State UniversityComputer GraphicszzzTxTyT2Scaling About the OriginxxxS yyyS mjb – September 5, 2014Oregon State UniversityComputer GraphicszzzS 2D Rotation About the Origincos sinxx ysin cosyx ymjb – September 5, 2014Oregon State UniversityComputer Graphicssin cosyx yLinear Equations in Matrix FormxAx By Cz DyExFyGzHzIxJyKzL x consuming columny consuming columnz consuming columnconstant columnmjb – September 5, 2014Oregon State UniversityComputer Graphics100011xABCD xyEFGHyzIJKLz          x’ producing rowy’ producing rowz’ producing rowIdentity Matrix ( [ I ] )1000xx  xxmjb – September 5, 2014Oregon State UniversityComputer Graphics[ I ] signifies that “Nothing has changed”010000101 0001 1yyzz   yyzzMatrix Inverse[M]•[M]-1= [I][M]•[M]-1= “Nothing has changed”mjb – September 5, 2014Oregon State UniversityComputer Graphics[][]gg“Whatever [M] does, [M]-1undoes”Translation Matrix100T  mjb – September 5, 2014Oregon State UniversityComputer Graphics1000100011 000 1 1xyzxTxyTyzTz     Quick! What is the inverse of this matrix?3Scaling Matrix000xS x mjb – September 5, 2014Oregon State UniversityComputer Graphics00000000 0100011xyzxS xyS yzSz       Quick! What is the inverse of this matrix?3D Rotation Matrix About ZRight-handed positive rotation ruleRight-handed coordinates+90º rotation gives: y’ = xYmjb – September 5, 2014Oregon State UniversityComputer Graphicscos sin 0 0sin cos 0 00010100011xxyyzz       gyXZ3D Rotation Matrix About YXYmjb – September 5, 2014Oregon State UniversityComputer GraphicsXZcos 0 sin 00100sin 0 cos 0100011xxyyzz          +90º rotation gives: x’ = z3D Rotation Matrix About XY+90º rotation gives: z’ = ymjb – September 5, 2014Oregon State UniversityComputer GraphicsXZ10 0 00cos sin 00sin cos 0100 011xxyyzz       How it Really Works :-)mjb – September 5, 2014Oregon State UniversityComputer Graphicshttp://xkcd.comCompound TransformationsAABBWrite itXYQ: Our rotation matrices only work around the origin? What if we want to rotate about an arbitrary point (A,B)?A: Use more than one matrix.mjb – September 5, 2014Oregon State UniversityComputer GraphicsWSay it,,11AB ABxxyyTRTzz         1234Matrix Multiplication is not CommutativeYRotate, then translateXYmjb – September 5, 2014Oregon State UniversityComputer GraphicsXTranslate, then rotateXYXMatrix Multiplication is Associative,,11AB ABxxyyTRTzz         mjb – September 5, 2014Oregon State UniversityComputer Graphics,,11AB ABxxyyTRTzz         One matrix –the Current Transformation Matrix, or CTM}Can Multiply All Geometry by One Matrix !AABBXY[]xxyyM   mjb – September 5, 2014Oregon State UniversityComputer GraphicsGraphics hardware can do this very quickly!11[]yyzzM    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 );glCallList( BoxList );. );. );at)Scale, (GLfloat)Scale );Typically objects are modeled around their own local origin, so theglTranslate( -A, -B, -C )mjb – September 5, 2014Oregon State UniversityComputer GraphicsglTranslatef( A, B, C );glRotatef( (GLfloat)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?