The translation is used for moving object from one position to another position like in 2D. There are three vectors in 3D to be changed for translation process as x, y, z axis. In 3D there are also the three translation vectors used. The translation in x direction represented as tx, in y-direction ty and in z direction it is represented as tz. If P (x, y, z) is the point which is going to be translated with the translation vectors (tx, ty, tz) then new vectors will be, X’=X+tx Y’=Y+ty Z’=Z+tz Following is the matrix for translation:
or
matrix representation will be, X’ 1 0 0 tx X Y’ = 0 1 0 ty Y Z’ 0 0 1 tz Z 1 0 0 0 1 1
Following figure 3.1.1 shows the translation process in 3D: Fig. no. 3.1.1
Summary: The translation process is used in 2D and 3D space. This process is used to translate the object from one axis to other in 3D. In process the X’, Y’ and Z’.
|
If the scaling vectors are different then it is known as differential scaling. In 3D there are three scaling factors as Sx, Sy and Sz. Sx for x direction, Sy for y direction and Sz for z direction. Matrix for scaling is shown as follows: Sx 0 0 0 0 Sy 0 0 0 0 Sz 0 0 0 0 1 It is mathematically represented as, P’=P * S [X’ Y’ Z’ 1] = [X Y Z 1] Sx 0 0 0 0 Sy 0 0 0 0 Sz 0 0 0 0 1 = [X. Sx Y. Sy Z. Sz 1] Steps for scaling the object if the object is located at the fixed place.
Following figure 3.1.2 shows the scaling in 3D transformation. Fig. no. 3.1.2
|
The object can be rotate anticlockwise or clockwise. This rotation is complex than the 2D rotation. In this the axis are also important with the angle of rotation. The axis can be x, y or z. Following figure 3.1.3 shows the rotation about y axis: Fig. no.3.1.3
Rotation matrix are represented as:
Rx(Ꙫ)=
Ry (Ꙫ)=
Rz (Ꙫ)=
|
Example: Following figure shows the initial position of P’ and P’’. Fig. no.3.1.4 (a) Translate object P’ to origin Fig. no. 3.1.4(b) Rotate P’’ to z axis so that it aligns along the z axis Fig. no.3.1.4(c) Rotate about around z axis Fig. no. 3.1.4(d) Rotate axis to the original position Fig. no. 3.1.4(e) Translate axis to the original position Fig. no. 3.1.4(f)
Summary: Following steps are used in rotation about an arbitrary axis.
|
The reflection axis and the reflection plane is selected for this process. 3D reflections are same as 2D reflections. Reflection is occurred on 180 degree about the given axis. The reflection can be done on xy, yz or xz axis. Following figure 3.1.5 shows the reflection on axeses. Fig. no. 3.1.5 Following are the reflection matrices used for three planes. Reflection about XY plane,
Reflection about YZ plane,
Reflection about XZ plane,
|
- Choose an endpoints of the line that is outside the window.
- Find the intersection point at the window boundary.
- Replace the endpoints with that intersection points and update the region code.
- Repeat step 2 until we get the clipped line either trivially accepted or trivially rejected.