## 3D Transformations in Computer Graphics-

We have discussed-

• Transformation is a process of modifying and re-positioning the existing graphics.
• 3D Transformations take place in a three dimensional plane.

In computer graphics, various transformation techniques are-

## 3D Scaling in Computer Graphics-

 In computer graphics, scaling is a process of modifying or altering the size of objects.

• Scaling may be used to increase or reduce the size of object.
• Scaling subjects the coordinate points of the original object to change.
• Scaling factor determines whether the object size is to be increased or reduced.
• If scaling factor > 1, then the object size is increased.
• If scaling factor < 1, then the object size is reduced.

Consider a point object O has to be scaled in a 3D plane.

Let-

• Initial coordinates of the object O = (Xold, Yold,Zold)
• Scaling factor for X-axis = Sx
• Scaling factor for Y-axis = Sy
• Scaling factor for Z-axis = Sz
• New coordinates of the object O after scaling = (Xnew, Ynew, Znew)

This scaling is achieved by using the following scaling equations-

• Xnew = Xold x Sx
• Ynew = Yold x Sy
• Znew = Zold x Sz

In Matrix form, the above scaling equations may be represented as-

## Problem-01:

Given a 3D object with coordinate points A(0, 3, 3), B(3, 3, 6), C(3, 0, 1), D(0, 0, 0). Apply the scaling parameter 2 towards X axis, 3 towards Y axis and 3 towards Z axis and obtain the new coordinates of the object.

## Solution-

Given-

• Old coordinates of the object  = A (0, 3, 3), B(3, 3, 6), C(3, 0, 1), D(0, 0, 0)
• Scaling factor along X axis = 2
• Scaling factor along Y axis = 3
• Scaling factor along Z axis = 3

### For Coordinates A(0, 3, 3)

Let the new coordinates of A after scaling = (Xnew, Ynew, Znew).

Applying the scaling equations, we have-

• Xnew = Xold x Sx = 0  x 2 = 0
• Ynew = Yold x Sy = 3 x 3 = 9
• Znew = Zold x Sz = 3 x 3 = 9

Thus, New coordinates of corner A after scaling = (0, 9, 9).

### For Coordinates B(3, 3, 6)

Let the new coordinates of B after scaling = (Xnew, Ynew, Znew).

Applying the scaling equations, we have-

• Xnew = Xold x Sx = 3  x 2 = 6
• Ynew = Yold x Sy = 3 x 3 = 9
• Znew = Zold x Sz = 6 x 3 = 18

Thus, New coordinates of corner B after scaling = (6, 9, 18).

### For Coordinates C(3, 0, 1)

Let the new coordinates of C after scaling = (Xnew, Ynew, Znew).

Applying the scaling equations, we have-

• Xnew = Xold x Sx = 3  x 2 = 6
• Ynew = Yold x Sy = 0 x 3 = 0
• Znew = Zold x Sz = 1 x 3 = 3

Thus, New coordinates of corner C after scaling = (6, 0, 3).

### For Coordinates D(0, 0, 0)

Let the new coordinates of D after scaling = (Xnew, Ynew, Znew).

Applying the scaling equations, we have-

• Xnew = Xold x Sx = 0  x 2 = 0
• Ynew = Yold x Sy = 0 x 3 = 0
• Znew = Zold x Sz = 0 x 3 = 0

Thus, New coordinates of corner D after scaling = (0, 0, 0).

To gain better understanding about 3D Scaling in Computer Graphics,

Watch this Video Lecture

Next Article- 3D Reflection in Computer Graphics

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.

## 3D Transformation in Computer Graphics-

 In Computer graphics,Transformation is a process of modifying and re-positioning the existing graphics.

• 3D Transformations take place in a three dimensional plane.
• 3D Transformations are important and a bit more complex than 2D Transformations.
• Transformations are helpful in changing the position, size, orientation, shape etc of the object.

### Transformation Techniques-

In computer graphics, various transformation techniques are-

## 3D Translation in Computer Graphics-

 In Computer graphics,3D Translation is a process of moving an object from one position to another in a three dimensional plane.

Consider a point object O has to be moved from one position to another in a 3D plane.

Let-

• Initial coordinates of the object O = (Xold, Yold, Zold)
• New coordinates of the object O after translation = (Xnew, Ynew, Zold)
• Translation vector or Shift vector = (Tx, Ty, Tz)

Given a Translation vector (Tx, Ty, Tz)-

• Tx defines the distance the Xold coordinate has to be moved.
• Ty defines the distance the Yold coordinate has to be moved.
• Tz defines the distance the Zold coordinate has to be moved.

This translation is achieved by adding the translation coordinates to the old coordinates of the object as-

• Xnew = Xold + Tx     (This denotes translation towards X axis)
• Ynew = Yold + Ty     (This denotes translation towards Y axis)
• Znew = Zold + Tz     (This denotes translation towards Z axis)

In Matrix form, the above translation equations may be represented as-

Also Read- 2D Translation in Computer Graphics

## Problem-

Given a 3D object with coordinate points A(0, 3, 1), B(3, 3, 2), C(3, 0, 0), D(0, 0, 0). Apply the translation with the distance 1 towards X axis, 1 towards Y axis and 2 towards Z axis and obtain the new coordinates of the object.

## Solution-

Given-

• Old coordinates of the object = A (0, 3, 1), B(3, 3, 2), C(3, 0, 0), D(0, 0, 0)
• Translation vector = (Tx, Ty, Tz) = (1, 1, 2)

### For Coordinates A(0, 3, 1)

Let the new coordinates of A = (Xnew, Ynew, Znew).

Applying the translation equations, we have-

• Xnew = Xold + Tx = 0 + 1 = 1
• Ynew = Yold + Ty = 3 + 1 = 4
• Znew = Zold + Tz = 1 + 2 = 3

Thus, New coordinates of A = (1, 4, 3).

### For Coordinates B(3, 3, 2)

Let the new coordinates of B = (Xnew, Ynew, Znew).

Applying the translation equations, we have-

• Xnew = Xold + Tx = 3 + 1 = 4
• Ynew = Yold + Ty = 3 + 1 = 4
• Znew = Zold + Tz = 2 + 2 = 4

Thus, New coordinates of B = (4, 4, 4).

### For Coordinates C(3, 0, 0)

Let the new coordinates of C = (Xnew, Ynew, Znew).

Applying the translation equations, we have-

• Xnew = Xold + Tx = 3 + 1 = 4
• Ynew = Yold + Ty = 0 + 1 = 1
• Znew = Zold + Tz = 0 + 2 = 2

Thus, New coordinates of C = (4, 1, 2).

### For Coordinates D(0, 0, 0)

Let the new coordinates of D = (Xnew, Ynew, Znew).

Applying the translation equations, we have-

• Xnew = Xold + Tx = 0 + 1 = 1
• Ynew = Yold + Ty = 0 + 1 = 1
• Znew = Zold + Tz = 0 + 2 = 2

Thus, New coordinates of D = (1, 1, 2).

Thus, New coordinates of the object = A (1, 4, 3), B(4, 4, 4), C(4, 1, 2), D(1, 1, 2).

To gain better understanding about 3D Translation in Computer Graphics,

Watch this Video Lecture

Next Article- 3D Rotation in Computer Graphics

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.