DOC PREVIEW
Princeton COS 426 - Modeling Transformations

This preview shows page 1-2-3 out of 8 pages.

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

Unformatted text preview:

1Modeling TransformationsAdam FinkelsteinPrinceton UniversityCOS 426, Spring 2003Modeling Transformations• Specify transformations for objects o Allows definitions of objects in own coordinate systemso Allows use of object definition multiple times in a sceneH&B Figure 109Overview• 2D Transformationso Basic 2D transformationso Matrix representationo Matrix composition• 3D Transformationso Basic 3D transformationso Same as 2D• Transformation Hierarchieso Scene graphso Ray casting2D Modeling TransformationsScaleRotateTranslateScaleTranslatexyWorld CoordinatesModelingCoordinates2D Modeling TransformationsxyWorld CoordinatesModelingCoordinatesLet’s lookat this indetail…2D Modeling TransformationsxyModelingCoordinates22D Modeling TransformationsxyModelingCoordinatesScale .3, .3Rotate -90Translate 5, 32D Modeling TransformationsxyModelingCoordinatesScale .3, .3Rotate -90Translate 5, 32D Modeling TransformationsxyModelingCoordinatesScale .3, .3Rotate -90Translate 5, 3World CoordinatesBasic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x * sx o y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ -y*sinΘo y’ = x*sinΘ + y*cosΘTransformations can be combined(with simple algebra)Basic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x * sx o y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ -y*sinΘo y’ = x*sinΘ + y*cosΘBasic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x *sxo y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ -y*sinΘo y’ = x*sinΘ + y*cosΘx’ = x*sxy’ = y*syx’ = x*sxy’ = y*sy(x,y)(x’,y’)3Basic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x * sx o y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ - y*sinΘo y’ = x*sinΘ + y*cosΘx’ = (x*sx)*cosΘ−(y*sy)*sinΘy’ = (x*sx)*sinΘ + (y*sy)*cosΘx’ = (x*sx)*cosΘ−(y*sy)*sinΘy’ = (x*sx)*sinΘ + (y*sy)*cosΘ(x’,y’)Basic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x * sx o y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ -y*sinΘo y’ = x*sinΘ + y*cosΘx’ = ((x*sx)*cosΘ−(y*sy)*sinΘ) + txy’ = ((x*sx)*sinΘ + (y*sy)*cosΘ) + tyx’ = ((x*sx)*cosΘ−(y*sy)*sinΘ) +txy’ = ((x*sx)*sinΘ + (y*sy)*cosΘ) + ty(x’,y’)Basic 2D Transformations• Translation:o x’ = x + txo y’ = y + ty• Scale:o x’ = x * sx o y’ = y * sy• Shear:o x’ = x + hx*yo y’ = y + hy*x• Rotation:o x’ = x*cosΘ -y*sinΘo y’ = x*sinΘ + y*cosΘx’ = ((x*sx)*cosΘ−(y*sy)*sinΘ) + txy’ = ((x*sx)*sinΘ + (y*sy)*cosΘ) + tyx’ = ((x*sx)*cosΘ−(y*sy)*sinΘ) + txy’ = ((x*sx)*sinΘ + (y*sy)*cosΘ) + tyOverview• 2D Transformationso Basic 2D transformationso Matrix representationo Matrix composition• 3D Transformationso Basic 3D transformationso Same as 2D• Transformation Hierarchieso Scene graphso Ray castingMatrix Representation• Represent 2D transformation by a matrix• Multiply matrix by column vector⇔ apply transformation to point=yxdcbayx''dcbadycxybyaxx+=+=''Matrix Representation• Transformations combined by multiplication=yxlkjihgfedcbayx''Matrices are a convenient and efficient way to represent a sequence of transformations!4=yxdcbayx''2x2 Matrices• What types of transformations can be represented with a 2x2 matrix?2D Identity?yyxx==''=yxyx1001''2D Scale around (0,0)?ysyyxsxx*'*'===yxdcbayx''=yxsysxyx00''2x2 Matrices• What types of transformations can be represented with a 2x2 matrix?2D Rotate around (0,0)?yxyyxx*cos*sin'*sin*cos'Θ+Θ=Θ−Θ==yxdcbayx''ΘΘΘ−Θ=yxyxcossinsincos''2D Shear?yxshyyyshxxx+=+=*'*'=yxdcbayx''=yxshyshxyx11''2x2 Matrices• What types of transformations can be represented with a 2x2 matrix?2D Mirror over Y axis?yyxx=−=''=yxdcbayx''−=yxyx1001''2D Mirror over (0,0)?yyxx−=−=''=yxdcbayx''−−=yxyx1001''=yxdcbayx''2x2 Matrices• What types of transformations can be represented with a 2x2 matrix?2D Translation?tyyytxxx+=+=''Only linear 2D transformations can be represented with a 2x2 matrixNO!Linear Transformations• Linear transformations are combinations of …o Scale,o Rotation,o Shear, ando Mirror• Properties of linear transformations:o Satisfies:o Origin maps to origino Lines map to lineso Parallel lines remain parallelo Ratios are preservedo Closed under composition)()()(22112211pppp TsTsssT +=+=yxdcbayx''2D Translation• 2D translation represented by a 3x3 matrixo Point represented with homogeneous coordinatestyyytxxx+=+=''=110010011''yxtytxyx5Homogeneous Coordinates• Add a 3rd coordinate to every 2D pointo (x, y, w) represents a point at location (x/w, y/w)o (x, y, 0) represents a point at infinityo (0, 0, 0) is not allowed1212(2,1,1)or (4,2,2) or (6,3,3)Convenient coordinate system to represent many useful transformationsxyBasic 2D Transformations• Basic 2D transformations as 3x3 matricesΘΘΘ−Θ=11000cossin0sincos1''yxyx=110010011''yxtytxyx=110001011''yxshyshxyxTranslateRotate


View Full Document

Princeton COS 426 - Modeling Transformations

Documents in this Course
Lecture

Lecture

35 pages

Lecture

Lecture

80 pages

Boids

Boids

25 pages

Exam 1

Exam 1

9 pages

Curves

Curves

4 pages

Lecture

Lecture

83 pages

Load more
Download Modeling 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 Modeling 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 Modeling 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?