1 / 44

Geometric Transformations

Geometric Transformations. Transformations. Local moving frame. Linear transformations Rigid transformations Affine transformations Projective transformations. T. Global reference frame. Linear Transformations. A linear transformation T is a mapping between vector spaces

Download Presentation

Geometric Transformations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Geometric Transformations

  2. Transformations Local moving frame • Linear transformations • Rigid transformations • Affine transformations • Projective transformations T Global reference frame

  3. Linear Transformations • A linear transformationT is a mapping between vector spaces • T maps vectors to vectors • linear combination is invariant under T • In 3D-spaces, T can be represented by a 3x3 matrix

  4. Affine Transformations • An affine transformationT is an mapping between affine spaces • T maps vectors to vectors, and points to points • T is a linear transformation on vectors • affine combination is invariant under T • In 3D-spaces, T can be represented by a 3x3 matrix together with a 3x1 translation vector

  5. Homogeneous Coordinates • Any affine transformation between 3D spaces can be represented by a 4x4 matrix • Affine transformation is linear in homogeneous coordinates

  6. Projective Spaces • Homogeneous coordinates • (x, y, z, w) = (x/w, y/w, z/w, 1) • Useful for handling perspective projection • But, it is algebraically inconsistent !!

  7. Examples of Affine Transformations • 2D rotation • 2D scaling

  8. Examples of Affine Transformations • 2D shear • 2D reflection

  9. Examples of Affine Transformations • 2D translation

  10. Examples of Affine Transformations • 2D transformation for vectors • Translation is simply ignored

  11. Examples of Affine Transformations • 3D rotation

  12. Pivot-Point Rotation • Rotation with respect to a pivot point (x,y)

  13. Fixed-Point Scaling • Scaling with respect to a fixed point (x,y)

  14. Scaling Direction • Scaling along an arbitrary axis

  15. Properties of Affine Transformations • Any affine transformation between 3D spaces can be represented as a combination of a linear transformation followed by translation • An affine transf. maps lines to lines • An affine transf. maps parallel lines to parallel lines • An affine transf. preserves ratios of distance along a line • An affine transf. does not preserve absolute distances and angles

  16. Review of Affine Frames • A frame is defined as a set of vectors {vi | i=1, …, N} and a point o • Set of vectors {vi} are bases of the associate vector space • o is an origin of the frame • N is the dimension of the affine space • Any point p can be written as • Any vector v can be written as

  17. Changing Frames • Affine transformations as a change of frame

  18. Changing Frames • Affine transformations as a change of frame

  19. Changing Frames • In case the xyz system has standard bases

  20. Rigid Transformations • A rigid transformationT is a mapping between affine spaces • T maps vectors to vectors, and points to points • T preserves distances between all points • T preserves cross product for all vectors (to avoid reflection) • In 3-spaces, T can be represented as

  21. Rigid Body Rotation • Rigid body transformations allow only rotation and translation • Rotation matrices form SO(3) • Special orthogonal group (Distance preserving) (No reflection)

  22. Rigid Body Rotation • R is normalized • The squares of the elements in any row or column sum to 1 • R is orthogonal • The dot product of any pair of rows or any pair columns is 0 • The rows (columns) of R correspond to the vectors of the principle axes of the rotated coordinate frame

  23. 3D Rotation About Arbitrary Axis

  24. 3D Rotation About Arbitrary Axis • Translation : rotation axis passes through the origin 2. Make the rotation axis on the z-axis 3. Do rotation 4. Rotation & translation

  25. 3D Rotation About Arbitrary Axis • Rotate u onto the z-axis

  26. 3D Rotation About Arbitrary Axis • Rotate u onto the z-axis • u’: Project u onto the yz-plane to compute angle a • u’’: Rotate u about the x-axis by angle a • Rotate u’’ onto the z-asis

  27. 3D Rotation About Arbitrary Axis • Rotate u’ about the x-axis onto the z-axis • Let u=(a,b,c) and thus u’=(0,b,c) • Let uz=(0,0,1)

  28. 3D Rotation About Arbitrary Axis • Rotate u’ about the x-axis onto the z-axis • Since we know both cos a and sin a, the rotation matrix can be obtained • Or, we can compute the signed angle a • Do not use acos() since its domain is limited to [-1,1]

  29. Euler angles • Arbitrary rotation can be represented by three rotation along x,y,z axis

  30. Gimble • Hardware implementation of Euler angles • Aircraft, Camera

  31. Euler Angles • Rotation about three orthogonal axes • 12 combinations • XYZ, XYX, XZY, XZX • YZX, YZY, YXZ, YXY • ZXY, ZXZ, ZYX, ZYZ • Gimble lock • Coincidence of inner most and outmost gimbles’ rotation axes • Loss of degree of freedom

  32. Euler Angles • Euler angles are ambiguous • Two different Euler angles can represent the same orientation • This ambiguity brings unexpected results of animation where frames are generated by interpolation.

  33. Taxonomy of Transformations • Linear transformations • 3x3 matrix • Rotation + scaling + shear • Rigid transformations • SO(3) for rotation • 3D vector for translation • Affine transformation • 3x3 matrix + 3D vector or 4x4 homogenous matrix • Linear transformation + translation • Projective transformation • 4x4 matrix • Affine transformation + perspective projection

  34. Rigid Taxonomy of Transformations Affine Projective

  35. Composite Transformations • Composite 2D Translation

  36. Composite Transformations • Composite 2D Scaling

  37. Composite Transformations • Composite 2D Rotation

  38. OpenGL Geometric Transformations • glMatrixMode(GL_MODELVIEW);

  39. OpenGL Geometric Transformations • Basic Transpormation: • glLoadIdentity(); • glTranslatef(tx, ty, tz); • glRotatef(theta, vx, vy, vz); angle-axis • (vx, vy, vz)is automatically normalized • glScalef(sx, sy, sz); • glLoadMatrixf(Glfloat elems[16]); • Multiplication • glMultMatrixf(Glfloat elems[16]); • The current matrix is postmultiplied by the matrix • Column major

  40. OpenGL Geometric Transformations • Getting the current matrix value: • glGetFloatv (GL_MODELVIEW_MATRIX, GLfloat elems[16]); • Column major GLfloat mat [16]; glGetFloatv (GL_MODELVIEW_MATRIX, mat);

  41. OpenGL Geometric Transformations • Matrix Direct Manipulation: • glLoadMatrixf(GLfloat elems[16]); • Column major • glMultMatrixf(GLfloat elems[16]); • The current matrix is postmultiplied by the matrix glLoadIdentity(); glMultMatrixf (M1); glMultMatrixf (M2); M = M1∙M2

  42. OpenGL GLUT Animation Function • GLUT Idle Callback fuction: • Idling: when there is nothing to do. • Redraw the scene: void MyIdle() { … // things to do … // when Idling } glutIdelFunc ( MyIdle ); glutPostRedisplay ( );

  43. Hierarchical Modeling • A hierarchical model is created by nesting the descriptions of subparts into one another to form a tree organization

  44. OpenGL Matrix Stacks • Four matrix modes • Modelview, projection, texture, and color • glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, stackSize); • Stack processing • The top of the stack is the “current” matrix • glPushMatrix(); // Duplicate the current matrix at the top • glPopMatrix(); // Remove the matrix at the top

More Related