310 likes | 797 Views
2D. 3D. Consideration for the z coordinate. 5.2 Three-Dimensional Geometric and Modeling Transformations. 5.2.1 Translation From position P=(x, y, z) to P ’ (x ’ , y ’ , z ’ ). Or P ’ =T · P. An equivalent representation:. x ’ =x +t x y’=y + t y z ’ =z + t z.
E N D
2D 3D Consideration for the z coordinate 5.2 Three-Dimensional Geometric and Modeling Transformations
5.2.1 Translation • From position P=(x, y, z) to P’ (x’, y’, z’) Or P’=T· P An equivalent representation: x’=x +tx y’=y + ty z’=z + tz
5.2.2 Rotation • Designate an axis of rotation and the amount of angular rotation
Coordinate-Axes Rotations Z-axis rotation equation: x'= x cosθ - y sinθ y' = x sinθ + y cosθ z'= z Homogeneous coordinate form Or P’= Rz(θ)· P
a cyclic permutation of the coordinate parameters x,y x → y → z → x Z-axis rotation equation: X-axis rotation equation: x'= x cosθ - y sinθ y' = x sinθ + y cosθ z'= z y'= y cosθ - z sinθ z' = y sinθ + z cosθ x'= x Or P’= Rz(θ)· P Or P’= Rx(θ)· P
X-axis rotation equation: Y-axis rotation equation: y'= y cosθ - z sinθ z' = y sinθ + z cosθ x'= x z'= z cosθ – x sinθ x' = z sinθ + x cosθ y' = y Or P’= Rx(θ)· P Or P’= Ry(θ)· P
General Three-Dimensional Rotations an object is to be rotated about an axis that is parallel to one of the coordinate axes Step 1: Translate the object so that the rotation axis coincides with the parallel coordinate axis.
General Three-Dimensional Rotations Step 2: Perform the specified rotation about that axis.
General Three-Dimensional Rotations Step 3: Translate the object so that the rotation axis is moved back to its original position.
rotation about an arbitrary axis (five steps) Step 1: Translate the object so that the rotation axis passes through the coordinate origin.
rotation about an arbitrary axis (five steps) Step 2:Rotate the object so that the axis of rotation coincides with one of the coordinate axes. Step 3:Perform the specified rotation about that coordinate axis.
rotation about an arbitrary axis (five steps) Step 4: Apply inverse rotations to bring the rotation axis back to its original orientation. Step 5: Apply the inverse translation to bring the rotation axis back to its original position.
5.2.3 Scaling • From position P=(x, y, z) to P’ (x’, y’, z’) Or P’=S· P An equivalent representation: x'= x' ·sx, y' = y·sy, z' = z·sz
Scaling with respect to a fixed position (xf, yf, zf,) Step 1: Translate the fixed point to the origin. Step 2: Scale the object relative to the coordinate origin . Step 3: Translate the fixed point back to its original position.
5.2.4 Other Transformation ---- reflection The matrix representation for this reflection of points relative to the xy plane is
5.2.4 Other Transformation The matrix representation for this reflection of points relative to the yz plane is The matrix representation for this reflection of points relative to the zx plane is
5.2.4 Other Transformation ---- shear As an example of three-dimensional shearing, the following transformation produces a z-axis shear: