Содержание
- 2. Basic geometric transformations Translation Rotation Scaling
- 3. 2D translation Figure 7-1 Translating a point from position P to position P’ using a translation
- 4. 2D translation equations Translation is a rigid-body transformation: Objects are moved without deformation.
- 5. 2D translation example Figure 7-2 Moving a polygon from position (a) to position (b) with the
- 6. 2D translation example program
- 7. 2D rotation All points of the object are transformed to new positions by rotating the points
- 8. 2D rotation Figure 7-4 Rotation of a point from position (x, y ) to position (x',
- 9. 2D rotation in matrix form Rotation is a rigid-body transformation: Objects are moved without deformation. Equations
- 10. Rotation about a general pivot point Figure 7-5 Rotating a point from position (x , y
- 11. 2D rotation example // Make necessary allocations!!
- 12. 2D scaling sx and sy are scaling factors sx scales an object in x direction sy
- 13. 2D scaling Figure 7-6 Turning a square (a) into a rectangle (b) with scaling factors sx
- 14. 2D scaling Figure 7-7 A line scaled with Equation 7-12 using sx = sy = 0.5
- 15. Scaling relative to a fixed point Figure 7-8 Scaling relative to a chosen fixed point (xf
- 16. 2D scaling relative to a fixed point
- 17. 2D scaling example // Make necessary allocations!!
- 18. Matrix representations and homogeneous coordinates Multiplicative and translational terms for a 2D transformation can be combined
- 19. 2D translation matrix
- 20. 2D rotation matrix
- 21. 2D scaling matrix
- 22. Inverse transformations Inverse translation Inverse rotation Inverse scaling
- 23. Composite transformations Composite transformation matrix is formed by calculating the product of individual transformations Successive translations
- 24. Composite transformations Successive rotations (additive) Successive scaling (multiplicative)
- 25. 2D pivot-point rotation Figure 7-9 A transformation sequence for rotating an object about a specified pivot
- 26. 2D pivot-point rotation Note the order of operations:
- 27. 2D fixed-point scaling Figure 7-10 A transformation sequence for scaling an object with respect to a
- 28. 2D fixed-point scaling
- 29. Matrix concatenation properties Multiplication is associative Multiplication is NOT commutative Unless the sequence of transformations are
- 30. Computational efficiency Formulation of a concatenated matrix may be more efficient Requires fewer multiply/add operations Rotation
- 31. Other transformations: reflection Figure 7-16 Reflection of an object about the x axis.
- 32. Reflection Figure 7-17 Reflection of an object about the y axis.
- 33. Reflection Figure 7-18 Reflection of an object relative to the coordinate origin. This transformation can be
- 34. Reflection Figure 7-19 Reflection of an object relative to an axis perpendicular to the xy plane
- 35. Reflection Figure 7-20 Reflection of an object with respect to the line y = x .
- 36. Other transformations: shear Distorts the shape of an object such that the transformed shape appears as
- 37. Shear Figure 7-24 A unit square (a) is transformed to a shifted parallelogram (b) with shx
- 38. Shear Figure 7-25 A unit square (a) is turned into a shifted parallelogram (b) with parameter
- 39. Transformations between 2D coordinate systems Figure 7-30 A Cartesian x' y' system positioned at (x0, y0)
- 40. Transformations x’y’ system can be obtained by rotation of xy by Θ counter-clockwise xy system can
- 41. Transformations between coordinate systems
- 42. Alternative method Figure 7-32 Cartesian system x' y' with origin at P0 = (x0, y0) and
- 43. Transformations Figure 7-33 A Cartesian x ' y' system defined with two coordinate positions, P0 and
- 44. Example: Rotating points vs. rotating coordinate systems Consider the following transformation: Rotation of points through 30o
- 45. Example continued You may think of this as mapping the origin and i and j axes
- 46. Example continued Now consider the point P=(x(2),y(2),1)T in System 2 What are the coordinates of this
- 47. OpenGL matrix operations glMatrixMode ( GL_MODELVIEW ) Designates the matrix that is to be used for
- 48. OpenGL transformation example
- 49. OpenGL transformation example Figure 7-34 Translating a rectangle using the OpenGL function glTranslatef (−200.0, −50.0, 0.0).
- 50. OpenGL transformation example Figure 7-35 Rotating a rectangle about the z axis using the OpenGL function
- 52. Скачать презентацию