3d Transformations Matrices and Equations

3d Transformations Matrices and Equations

3d Transformations Matrices and Equations

The major difference in 2d and 3d transformations is another dimension. 3d has one more dimension called z axis.

The floor of the room is an example of 2d where in only two dimensions matters, one is length (x axis) and other one breadth (y axis). Lets include the height of the room, now you have three dimensions length , breadth and height which is nothing but 3 dimensions.

In terms of computer graphics, another row or column (z axis) gets added in the matrices and equations of transformations. Three dimension will have x,y and z axis.


 

Translation

Translation equations and matrices. The new coordinates (x’,y’,z’) are given by following equations, where tx, ty and tz are the translation factors.

X’= X + tx

Y’= Y * ty

Z’=Z + tz

and in terms of Matrix

3d Translation


Rotation Transformation in 3d

Rotation is not as simple as in 2d transformations. Just remember the two golden rules.

Rule 1– Remember the rotation equations for 2 dimension.

Rule 2- Change x to y and y to z and z to x in the equations obtained after first transformations. X=>Y=>Z=>X. 

Rotaiton in 3d can be with respect to x axis , y axis or z axis. If its is done with respect to x axis then x coordinate wont change and if done with respect to y axis then y would remain the same. Similarly z’=z would mean the rotation has been done with respect to z axis.


Rotation w.r.t z axis

Remember the rotation equation from 2dimension (2d rotation), where coordinates of x’ and y’ are given as, Add z’=z. 

Equation_Z_Axis

Please note z’=z for rotation with respect to z axis. Write these equation in matrices as follows. Remember – Write coefficients of x from equations above in first column, y in second column and z in third column.


Rotation w.r.t X axis.

Apply the rule number 2 and change the equations written in rule number 1 as change x=>y, y=>z and z=>x. You will get the following equations, please notice that x remains unchanged.

Write down these equations in the form of a matrix.


Rotation w.r.t Y Axis

Apply the rule number 2 and change the equations obtained in rotation w.r.t x-axis. Change x=>y, y=>z and z=>x. You will get the following equations, please notice that x remains unchanged.


Scaling Transformation in 3d.

Scaling will have sz as one more factor other than sx and sy. Basic rule will remain the same, if any of the scaling factor is less than 1 then compression happens and if sx,sy or sz > 1 then magnification.

Zoom in and Zoom out are the best examples of the scaling.

Equations:

These can be written in form of matrix as follows.

We have disabled - Right- Click - How about stay to read :)