BIT304 · 2082 · 10 marks
What is scaling in 3D graphics? Derive the scaling matrix for scaling along the X, Y, and Z axes. Apply the scaling transformation to a point (2,3,4) with scaling factors Sx = 2, Sy = 3, Sz = 4.
What is scaling in 3D graphics? Derive the scaling matrix for scaling along the X, Y, and Z axes. Apply the scaling transformation to a point (2,3,4) with scaling factors $S_x = 2$, $S_y = 3$, $S_z = 4$. [10]
Scaling in 3D Graphics
Given
- Point: $P = (2, 3, 4)$
- Scaling factors: $S_x = 2$, $S_y = 3$, $S_z = 4$
Solution
Definition of Scaling
Scaling is a geometric transformation that alters the size of an object by multiplying each coordinate of its points by scaling factors along the coordinate axes. If all factors are equal, the scaling is uniform (shape preserved); if they differ, it is non-uniform (shape distorted). Scaling is performed relative to the origin unless a fixed point is specified.
Derivation of the Scaling Matrix
For a point $P(x, y, z)$, scaling produces $P'(x', y', z')$ such that each coordinate is multiplied by its scaling factor:
$$x' = S_x \cdot x, \qquad y' = S_y \cdot y, \qquad z' = S_z \cdot z$$
Writing this as a matrix relation on the 3-vector:
$$ \begin{bmatrix} x' \ y' \ z' \end{bmatrix}
\begin{bmatrix} S_x & 0 & 0 \ 0 & S_y & 0 \ 0 & 0 & S_z \end{bmatrix} \begin{bmatrix} x \ y \ z \end{bmatrix} $$
The off-diagonal entries are zero because each new coordinate depends only on the corresponding old coordinate. To combine scaling with translation using a single uniform representation, we use homogeneous coordinates, giving the $4 \times 4$ scaling matrix:
$$S = \begin{bmatrix} S_x & 0 & 0 & 0 \ 0 & S_y & 0 & 0 \ 0 & 0 & S_z & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}$$
The bottom-right element is $1$ so that the homogeneous component ($w = 1$) is unchanged.
Application to the Point (2, 3, 4)
Step 1: Construct the scaling matrix
$$S = \begin{bmatrix} 2 & 0 & 0 & 0 \ 0 & 3 & 0 & 0 \ 0 & 0 & 4 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}$$
Step 2: Point in homogeneous coordinates
$$P = \begin{bmatrix} 2 \ 3 \ 4 \ 1 \end{bmatrix}$$
Step 3: Apply $P' = S \cdot P$
$$ P' = \begin{bmatrix} 2 & 0 & 0 & 0 \ 0 & 3 & 0 & 0 \ 0 & 0 & 4 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 2 \ 3 \ 4 \ 1 \end{bmatrix}
\begin{bmatrix} 2 \times 2 \ 3 \times 3 \ 4 \times 4 \ 1 \end{bmatrix}
\begin{bmatrix} 4 \ 9 \ 16 \ 1 \end{bmatrix} $$
Final Result
$$\boxed{P' = (4,\ 9,\ 16)}$$
The point $(2, 3, 4)$ scales to $(4, 9, 16)$ under factors $S_x = 2$, $S_y = 3$, $S_z = 4$.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.