Methods for geometric transformations and object modeling in 3D are extended from 2D methods by including the considerations for the z coordinate.
Basic Transformations
Translation
We translate a 3D point by adding translation distances, tx, ty, and tz, to the original coordinate position (x,y,z):
x' = x + tx, y' = y + ty, z' = z + tz
Scaling
Scaling With Respect to the Origin
We scale a 3D object with respect to the origin by setting the scaling factors sx, sy and sz, which are multiplied to the original vertex coordinate positions (x,y,z):
x' = x * sx, y' = y * sy, z' = z * sz
Coordinate-Axes Rotations
A 3D rotation can be specified around any line in space. The easiest rotation axes to handle are the coordinate axes.
3D Rotations about an Axis which is parallel to an Axis
- Step 1. Translate the object so that the rotation axis coincides with the parallel coordinate axis.
- Step 2. Perform the specified rotation about that axis.
- Step 3. Translate the object so that the rotation axis is moved back to its original position.
General 3D Rotations
- Step 1. Translate the object so that the rotation axis passes through the coordinate origin.
- 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.
- Step 4. Rotate the object so that the rotation axis is brought back to its original orientation.
- Step 5. Translate the object so that the rotation axis is brought back to its original position.
No comments:
Post a Comment