6.837-5 Transformations 1: Translation, Rotation and Scale

Add to Favourites
Post to:

MIT EECS 6.837, Durand and Cutler TransformationsMIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler Cool Results from Assignment 0emmavpsotoscyudits (Courtesy of Emily Vincent. Used with permission.) (Courtesy of Paul Soto. Used with permission.) (Image removed due to copyright considerations.) (Image removed due to copyright considerations.) (Courtesy of Sophia Yuditskaya. Used with permission.)MIT EECS 6.837, Durand and Cutler Notes on Assignments•Make sure you turn in a linuxor windowsexecutable (so we can test your program)•Collaboration Policy–Share ideas, not code•Tell us how much time you spent on each assignmentMIT EECS 6.837, Durand and Cutler Quick Review of Last Week•Ray representation•Generating rays from eyepoint/camera–orthographic camera–perspective camera•Find intersection point & surface normal•Primitives:–spheres, planes, polygons, triangles, boxesMIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler What is a Transformation?•Maps points (x, y) in one coordinate system to points (x', y') in another coordinate system•For example, IFS:x' = ax+ by + cy' = dx+ ey+ fMIT EECS 6.837, Durand and Cutler Common Coordinate Systems•Object space–local to each object•World space–common to all objects•Eye space /Camera space–derived from view frustum•Screen space–indexed according to hardware attributes NEAR EYE FAR y z x o y y x x z z o NDC NDCNDC ((Courtesy of Seth Teller. Used with permission.)MIT EECS 6.837, Durand and Cutler Simple Transformations•Can be combined•Are these operations invertible?Yes, except scale = 0MIT EECS 6.837, Durand and Cutler Transformations are used:•Position objects in a scene (modeling)•Change the shape of objects•Create multiple copies of objects•Projection for virtual cameras•AnimationsMIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Rigid Body /Euclidean Transforms•Similitudes/Similarity Transforms •Linear•Affine•Projective•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler Rigid-Body /Euclidean Transforms •Preserves distances•Preserves anglesTranslationRotationRigid /EuclideanIdentityMIT EECS 6.837, Durand and Cutler Similitudes/Similarity Transforms•Preserves anglesTranslationRotationRigid /EuclideanSimilitudesIsotropic ScalingIdentityMIT EECS 6.837, Durand and Cutler Linear TransformationsTranslationRotationRigid /EuclideanLinearSimilitudesIsotropic ScalingIdentityScalingShearReflectionMIT EECS 6.837, Durand and Cutler Linear Transformations•L(p+ q) = L(p) + L(q)•L(ap) = a L(p)TranslationRotationRigid /EuclideanLinearSimilitudesIsotropic ScalingScalingShearReflectionIdentityMIT EECS 6.837, Durand and Cutler Affine Transformations•preserves parallel linesTranslationRotationRigid /EuclideanLinearSimilitudesIsotropic ScalingScalingShearReflectionIdentityAffineMIT EECS 6.837, Durand and Cutler Projective Transformations•preserves linesProjectiveTranslationRotationRigid /EuclideanLinearAffineSimilitudesIsotropic ScalingScalingShearReflectionPerspectiveIdentityMIT EECS 6.837, Durand and Cutler Perspective ProjectionMIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler How are Transforms Represented?x' = ax+ by + cy' = dx+ ey+ fx'y'xycfa bd e+=p' = Mp + tMIT EECS 6.837, Durand and Cutler Homogeneous Coordinates•Add an extra dimension•in 2D, we use 3 x 3 matrices•In 3D, we use 4 x 4 matrices•Each point has an extra value, wxyzwaeimbfjncgkodhlpx'y'z'w'=p' = MpMIT EECS 6.837, Durand and Cutler Homogeneous Coordinates•Most of the time w = 1, and we can ignore it•If we multiply a homogeneous coordinate by an affine matrix, w is unchangedxyz1aei0bfj0cgk0dhl1x'y'z'1=MIT EECS 6.837, Durand and Cutler Homogeneous Visualization•Divide by w to normalize (homogenize)•W = 0? w= 1w= 2(0, 0, 1) = (0, 0, 2) = …(7, 1, 1) = (14, 2, 2) = …(4, 5, 1) = (8, 10, 2) = …Point at infinity (direction)MIT EECS 6.837, Durand and Cutler Translate (tx, ty, tz)Translate(c,0,0)xyp•Why bother with the extra dimension?Because now translations can be encoded in the matrix!p'cxyz1100001000010txtytz1x'y'z'0x'y'z'1=MIT EECS 6.837, Durand and Cutler Scale (sx, sy, sz)Scale(s,s,s)xpp'qq'y•Isotropic (uniform) scaling: sx= sy= szxyz1sx0000sy0000sz00001x'y'z'1=MIT EECS 6.837, Durand and Cutler RotationZRotate(θ)yzpp'θ•About z axisxxyz1cosθsin θ00-sin θcosθ0000100001x'y'z'1=MIT EECS 6.837, Durand and Cutler Rotationxyz10cosθsin θ00-sin θcosθ010000001x'y'z'1•About x axis:•About y axis:=xyz1cosθ0-sin θ0sin θ0cosθ001100001x'y'z'1=MIT EECS 6.837, Durand and Cutler RotationRotate(k, θ)yzθk•About (kx, ky, kz), a unit vector on an arbitrary axis(RodriguesFormula)xxyz1kxkx(1-c)+ckykx(1-c)+kzskzkx(1-c)-kys00001kzkx(1-c)-kzskzkx(1-c)+ckzkx(1-c)-kxs0kxkz(1-c)+kyskykz(1-c)-kxskzkz(1-c)+c0x'y'z'1=where c = cosθ& s = sin θMIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler How are transforms combined?Scale then Translate(0,0)(1,1)(0,0)(2,2)Scale(2,2)(5,3)(3,1)Translate(3,1)Use matrix multiplication: p' = T ( S p ) = TS p100131200200200231001TS ==001001Caution: matrix multiplication is NOT commutative!MIT EECS 6.837, Durand and Cutler Non-commutative CompositionScale then Translate: p' = T ( S p ) = TS pTranslate then Scale: p' = S ( T p ) = ST p(0,0)(1,1)(4,2)(3,1)(8,4)(6,2)(0,0)(1,1)(0,0)(2,2)Scale(2,2)(5,3)(3,1)Translate(3,1)Translate(3,1)Scale(2,2)MIT EECS 6.837, Durand and Cutler Non-commutative CompositionScale then Translate: p' = T ( S p ) = TS p100010311200020001200020311TS ==Translate then Scale: p' = S ( T p ) = ST p200200100131200262001ST ==001001MIT EECS 6.837, Durand and Cutler Outline•Assignment 0 Recap•Intro to Transformations•Classes of Transformations•Representing Transformations•Combining Transformations•Change of OrthonormalBasisMIT EECS 6.837, Durand and Cutler Review of Dot ProductbaMIT EECS 6.837, Durand and Cutler Change of OrthonormalBasis•Given: coordinate frames xyzand uvnpoint p= (x,y,z) •Find:p= (u,v,n)xyvupxyuvpzxyvunMIT EECS 6.837, Durand and Cutler Change of OrthonormalBasisyy(x. u) u(y. u) u(z. u) u(x. v) v(y. v) v(z. v) v(x. n) n(y. n) n(z. n) nxyz===++++++xzvux. ux. vy. vy. unvuxMIT EECS 6.837, Durand and Cutler Change of OrthonormalBasisxyz(x. u) u(y. u) u(z. u) u(x. v) v(y. v) v(z. v) v(x. n) n(y. n) n(z. n) n++++++===Substitute into equation for p:p= (x,y,z) = x x+ y y+ z z+++x[y[z[(x. n) n(y. n) n(z. n) n(x. u) u(y. u) u(z. u) up=+++(x. v) v(y. v) v(z. v) v] +] +]MIT EECS 6.837, Durand and Cutler Change of OrthonormalBasis+++x[y[z[p=(x. u) u(y. u) u(z. u) u+++(x. v) v(y. v) v(z. v) v(x. n) n(y. n) n(z. n) n] +] +]Rewrite:+++] u+] v+] nz (z. u)z (z. v)z (z. n)+++x (x. u)x (x. v)x (x. n)y (y. u)y (y. v)y (y. n)[[[p=MIT EECS 6.837, Durand and Cutler Change of OrthonormalBasis+++] u+] v+] nz (z. u)z (z. v)z (z. n)+++x (x. u)x (x. v)x (x. n)y (y. u)y (y. v)y (y. n)[[[p=p= (u,v,n) = u u+ v v+ n nExpressed in uvnbasis:+++y(y. u)y(y. v)y(y. n)z(z. u)z(z. v)z(z. n)x(x. u)x(x. v)x(x. n)+++uvn===MIT EECS 6.837, Durand and Cutler Change of OrthonormalBasis+++y(y. u)y(y. v)y(y. n)z(z. u)z(z. v)z(z. n)x(x. u)x(x. v)x(x. n)+++uvn===In matrix form:uvn=xyzuxvxnxuyvynyuzvznzux= x . uwhere:uy= y . uetc.MIT EECS 6.837, Durand and Cutler Change of OrthonormalBasisxyzxyzuxvxnxuyvynyuzvznzuvn= M=What's M-1, the inverse?xyzxuyuzuxvyvzvxnynznuvnux= x . u = u . x = xu=M-1= MTMIT EECS 6.837, Durand and Cutler Next Time:Adding Transformationsto the Ray Caster(Assignment 2)

Description
The topics covered inthis particular lecture note are Intro to Transformations ,Classes of Transformations, Representing, Transformations and Combining Transformations.

•Change of OrthonormalBasis“Prof. Frédo Durand & Prof. Barbara , 6.837-5 Transformations 1: Translation, Rotation and Scale, 6.837 Computer Graphics ,Electrical Engineering and Computer Science, Engineering, Massachusetts Institute of Technology: MIT Open Course Ware,http://ocw.mit.edu (22-08-2011).License: Creative Commons BY-NC-SA: http://ocw.mit.edu/terms/#cc".

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
LearnOnline Through OCW
OpenCourseWare
User
102 Followers

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect