1 / 69

Transformation of Graphics

Transformation of Graphics. University of Science and Technology of Beijing 沈政伟. What is geometric transformation? Operations that are applied to the geometric description of an object to change its position, orientation, or size are called geometric transformations.

kelly-weeks
Télécharger la présentation

Transformation of Graphics

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. Transformation of Graphics University of Science and Technology of Beijing 沈政伟 لطفا سکوت را رعایت فرمایید.

  2. What is geometric transformation? • Operations that are applied to the geometric description of an object to change its position, orientation, or size are called geometric transformations. لطفا سکوت را رعایت فرمایید.

  3. So the geometric-transformation functions that are available in some system are following: • Translation • Rotation • Scaling • Other useful transforms includes: reflection and shear. In our lesson, we first consider operation in two dimensions, then we discuss how these basic ideas can be extended to three-dimensional scenes. لطفا سکوت را رعایت فرمایید.

  4. Translation • Rotation لطفا سکوت را رعایت فرمایید.

  5. Scaling • Uniform Scaling • Un-uniform Scaling لطفا سکوت را رعایت فرمایید.

  6. Reflection • Shear لطفا سکوت را رعایت فرمایید.

  7. Why do we need geometric transformations in CG( motivation )? • As a viewing aid • As a modeling tool • As an image manipulation tool لطفا سکوت را رعایت فرمایید.

  8. Two-Dimensional(2D) Translation We perform a translation on a single coordinate point by adding offsets to its coordinates so as to generate a new coordinate position. Similarly, a translation is applied to an object that is defined with multiple coordinate positions by relocating all the coordinate positions by the same displacement along parallel paths. Suppose tx and ty is the translation distances, (x, y) is the original coordinates, is the new coordinate position. لطفا سکوت را رعایت فرمایید.

  9. Express the translation use matrix equation as following: • Translation is a rigid-body transformation that moves objects without deformation. Question : How to translate a line segment or a polygon? لطفا سکوت را رعایت فرمایید.

  10. Two-Dimensional Rotation • We generate a rotation transformation of an object by specifying a rotation axis and a rotation angle. All points of the object are then transformed to new positions by rotating the points through the specified angle about the rotation axis. • A 2D rotation of an object is obtained by repositioning the object along a circular path in the xy plane, the rotation axis is perpendicular to the xy plane. • Parameters for 2D rotation is rotation angle and a rotation point( pivot point) . • Rotation angle define a positive values for counterclockwise rotation about the pivot point. لطفا سکوت را رعایت فرمایید.

  11. r is the constant distance of the point form the origin, angle is the original angular position of the point from the horizontal, and is the rotation angle. • Substitute expression (1) into (2) (1) (2) لطفا سکوت را رعایت فرمایید.

  12. (3) Matrix form لطفا سکوت را رعایت فرمایید.

  13. (3) • Question 1: • If the rotation point is an arbitrary pivot position , can you give the correct rotation expression? • How to rotate a line segment or a polygon? لطفا سکوت را رعایت فرمایید.

  14. لطفا سکوت را رعایت فرمایید.

  15. لطفا سکوت را رعایت فرمایید.

  16. Two-Dimensional(2D) Scaling • To alter the size of an object, we apply a scaling transformation. A simple two-dimensional scaling operation is performed by multiplying object positions (x, y) by scaling factors sx and sy to produce the transformed coordinate . • Scaling factors sx scales an object in the x coordinate. لطفا سکوت را رعایت فرمایید.

  17. Properties of the scaling transformation. • Any positive values can be assigned to the scaling factors sx and sy. Values less then 1 reduce the size of object, the object will close up the original at the same time. In contrast , enlarge the size of object. • When sx and sy are assigned to the same values, a uniform scaling is produced which maintains relative object proportions. لطفا سکوت را رعایت فرمایید.

  18. Unequal values for sx and sy result in a differential scaling that is often used in design applications. • Negative values can also be specified for the scaling parameters, this not only resizes an object, it reflects the object one or more of the coordinate axes. لطفا سکوت را رعایت فرمایید.

  19. لطفا سکوت را رعایت فرمایید.

  20. لطفا سکوت را رعایت فرمایید.

  21. Matrix Representations and Homogeneous Coordinates • It is well known that many application involves sequences of geometric transformations. For example, an animation might require an object to be translated, rotated and scaled at each increment of the motion. If you want to first rotates an object, then scales it, you can combine those two transformation to a composite transformation like the following equation: لطفا سکوت را رعایت فرمایید.

  22. However, it will be difficult to deal with the above composite transformation and translation together. Because, translation is not 2 by 2 matrix representation. • So ,here we consider how the matrix representations discussed in the previous sections can be reformulated so that such transformation sequences can be efficiently processed. لطفا سکوت را رعایت فرمایید.

  23. In fact, we can expressed three basic two-dimensional transformation( translation, rotation, and scaling) in the general matrix form: • Now this equation can be reformulated to eliminate the matrix addition operation using Homogeneous Coordinates. لطفا سکوت را رعایت فرمایید.

  24. What is Homogeneous Coordinates? • A standard technique for expanding each two-dimensional coordinate position representation (x, y) to three-element representation , called Homogeneous Coordinates, where homogeneous h is a nonzero value such that • For geometric transformation, we can chose the homogeneous parameter h to be any nonzero value. Thus there are an infinite number of equivalent homogeneous representations for each coordinate point (x, y) . لطفا سکوت را رعایت فرمایید.

  25. A convenient choice is simply to set h=1, so each two-dimensional position is then represented with homogeneous coordinate (x,y,1). • Expressing positions in homogenous coordinates allows us to represent all geometric transformation equations as matrix multiplications, which is the standard method used in graphics systems. Two dimensional coordinate positions are represented with three-elements column vectors, and two-dimensional transformation operations are expressed as 3X3 matrices. لطفا سکوت را رعایت فرمایید.

  26. Homogeneous coordinate representation of 2D Translation • This translation operation can be written in the abbreviated form لطفا سکوت را رعایت فرمایید.

  27. Homogeneous coordinate representation of 2D Rotation This translation operation can be written in the abbreviated form لطفا سکوت را رعایت فرمایید.

  28. Homogeneous coordinate representation of 2D Scaling This scaling operation can be written in the abbreviated form لطفا سکوت را رعایت فرمایید.

  29. Properties of homogeneous coordinate 2D transformation. • (1) translation and rotation have additive properties. • (2) scaling transformation has multiplicative properties. لطفا سکوت را رعایت فرمایید.

  30. Question : • Write out the inverse homogeneous matrix representation of 2D transformation. لطفا سکوت را رعایت فرمایید.

  31. Two-Dimensional Composite Transformation • Using matrix representations, we can set up a sequence of transformation as a composite transformation matrix, by calculating the product of the individual transformations. • And, since many positions in a scene are typically transformed by the same sequence, its is more efficient to first multiply the transformation matrices to form a single composite matrix. • So the coordinate position is transformed using the composite matrix M, rather than applying the individual transformations M1 and then M2 لطفا سکوت را رعایت فرمایید.

  32. Composite Two-Dimensional Translations, Rotation and Scaling: لطفا سکوت را رعایت فرمایید.

  33. (xr,yr) (xr,yr) (xr,yr) (xr,yr) • General Two-Dimensional Pivot-Point Rotation • So we can generate a 2D rotation about any other pivot point (x, y) by performing the following sequence of translate-rotate-translate operations. لطفا سکوت را رعایت فرمایید.

  34. (1) Translate the object so that the pivot-point position is moved to the coordinate origin. • (2) Rotate the object about the coordinate origin. • (3) Translate the object so that the pivot point is returned to its original position. • The composite transformation matrix for this sequence is obtained with the concatenation: لطفا سکوت را رعایت فرمایید.

  35. Which can be expressed in the form لطفا سکوت را رعایت فرمایید.

  36. Similarly, we can obtain the matrix representation of General 2D Fixed-Point Scaling.( question ). • (1) Translate the object to so that the fixed point coincides with the coordinate origin. • (2) Scale the object with respect to the coordinate origin. • (3) Use the inverse of the translation in step (1) to return the object to its original position. لطفا سکوت را رعایت فرمایید.

  37. (xr,yr) (xr,yr) (xr,yr) (xr,yr) Translate Scale Translate لطفا سکوت را رعایت فرمایید.

  38. We also obtain General 2D Scaling Directions. • Suppose we want to apply scaling factors with values specified by parameters s1 and s2 in the directions shown in the following fig. لطفا سکوت را رعایت فرمایید.

  39. To accomplish the scaling without changing the orientation of the object.(1) we perform a rotation so that the directions for s1 and s2 coincide with the x and y axes, respectively. (2) Then the scaling transformation S(s1,s2) is applied. (3) An opposite rotation to return points to their original orientations. لطفا سکوت را رعایت فرمایید.

  40. لطفا سکوت را رعایت فرمایید.

  41. y y (2,2) (1/2,3/2) (0,1) (1,1) (3/2,1/2) x (0,0) (1,0) x (0,0) • For example, we turn a unit square into a parallelogram by stretching it along the diagonal from (0,0) to (1,1). Scale لطفا سکوت را رعایت فرمایید.

  42. We first rotate the diagonal onto the y axis using angle 45 degree. Then we double its length with the scaling values s1=1 and s2=2, and then we rotate again to return the diagonal to its original orientation. لطفا سکوت را رعایت فرمایید.

  43. Matrix Concatenation Properties • (1) Multiplication of matrices is associative. • (2) Transformation products, on the other hand, may not be commutative. لطفا سکوت را رعایت فرمایید.

  44. X axis • yaxis • original point • Other 2D transformations: • Reflection with respect to the axis y 1 y y 1 1’ 1’ 2 3 2 3 3’ 2 3’ 2 x x x 3 2’ 3’ 1 2 1’ لطفا سکوت را رعایت فرمایید.

  45. y x • Reflection with respect to a line لطفا سکوت را رعایت فرمایید.

  46. Shear لطفا سکوت را رعایت فرمایید.

  47. Three-Dimensional Transformations لطفا سکوت را رعایت فرمایید.

  48. Methods for geometric transformations in three dimensions are extended from two-dimensional methods by including considerations for the z coordinate. • A three-dimensional position, expressed in homogeneous coordinates, is represented as a four-element column vector. Thus , each geometric transformation operator is now 4 by 4 matrix. لطفا سکوت را رعایت فرمایید.

  49. We can express the 3D translation operation in matrix form. لطفا سکوت را رعایت فرمایید.

  50. Three-Dimensional Rotation • (1) 3D Coordinate-Axis Rotations • z-axis rotation (counter-clockwise) لطفا سکوت را رعایت فرمایید.

More Related