3D Scaling

Scaling is the transformation responsible for changing the size of an object in 3D space making it bigger, smaller, or distorting it unevenly along different directions. Unlike translation and rotation, scaling is not a rigid-body transformation: it can change both the size and, if applied unevenly, the shape of an object.

What is Scaling?

Scaling resizes an object along the X, Y, and Z directions by multiplying each coordinate of every point by a corresponding scale factor. The three scale factors are usually denoted:

  • sx - scale factor along the X-axis
  • sy - scale factor along the Y-axis
  • sz - scale factor along the Z-axis

If a scale factor is greater than 1, the object expands along that axis. If it's between 0 and 1, the object shrinks along that axis. A scale factor of exactly 1 leaves that dimension unchanged.


Mathematical Definition

For a point P(x, y, z), after scaling by factors (sx, sy, sz), the new point P'(x', y', z') is given by:

x' = x · sx
y' = y · sy
z' = z · sz

This relationship is multiplicative, which is why unlike translation scaling can be expressed directly as an ordinary matrix multiplication, without needing the homogeneous coordinate trick. 

However, for consistency with translation and rotation (so all three can be combined into one pipeline), it is still expressed using a 4×4 matrix in homogeneous coordinates.


The Scaling Matrix

In homogeneous coordinates, the scaling matrix about the origin is:

S(sx, sy, sz) = | sx  0   0   0 |
                | 0   sy  0   0 |
                | 0   0   sz  0 |
                | 0   0   0   1 |

Applying this to a point P(x, y, z, 1):

| x' |   | sx  0   0   0 | | x |
| y' | = | 0   sy  0   0 | | y |
| z' |   | 0   0   sz  0 | | z |
| 1  |   | 0   0   0   1 | | 1 |

Expanding confirms it reproduces the basic equations:

x' = sx·x + 0·y + 0·z + 0·1 = sx·x
y' = 0·x + sy·y + 0·z + 0·1 = sy·y
z' = 0·x + 0·y + sz·z + 0·1 = sz·z

Types of Scaling

1. Uniform Scaling

When all three scale factors are equal (sx = sy = sz), the object grows or shrinks proportionally in all directions. Its overall shape is preserved only its size changes. This is the most commonly used type of scaling in practice (e.g., resizing a 3D model uniformly so it doesn't appear stretched).

2. Non-Uniform (Differential) Scaling

When the scale factors differ (sx ≠ sy ≠ sz), the object is distorted stretched more along some axes than others. 

This changes the object's proportions and shape, not just its overall size. Non-uniform scaling is useful for deliberately stretching or squashing objects, such as flattening a sphere into an ellipsoid.

3. Special Cases

  • sx = sy = sz = 1: Identity transformation no change.
  • A scale factor = 0: The object collapses (flattens) completely along that axis, projecting it onto a plane.
  • A scale factor is negative: The object is both scaled and reflected (mirrored) along that axis. For example, sx = -1 reflects the object across the YZ-plane while keeping its size the same.

5. Geometric Interpretation

Scaling about the origin treats the origin as a fixed anchor point points closer to the origin move less, and points farther from the origin move more, all in proportion to the scale factor. 

This is why scaling about the origin can unintentionally move an object's position if the object isn't centered at the origin to begin with (its centroid shifts along with everything else).


Scaling about an Arbitrary Fixed Point

In most practical situations, you don't want to scale an object relative to the world origin you want to scale it relative to its own center (or some other chosen pivot point), so the object grows or shrinks "in place" without drifting away from its original position.

Procedure

To scale an object by (sx, sy, sz) about a fixed point F(px, py, pz):

  1. Translate the fixed point to the origin: T(-px, -py, -pz)
  2. Scale about the origin: S(sx, sy, sz)
  3. Translate back to the original location: T(px, py, pz)

Combined Matrix

S' = T(px, py, pz) · S(sx, sy, sz) · T(-px, -py, -pz)

This "translate–transform–translate back" pattern is a general technique used not just for scaling, but for rotation about an arbitrary axis as well it's one of the most important patterns in transformation theory.

Let's multiply this out explicitly.

Step 1: T(-px, -py, -pz)

| 1  0  0  -px |
| 0  1  0  -py |
| 0  0  1  -pz |
| 0  0  0   1  |

Step 2: S(sx, sy, sz)

| sx  0   0   0 |
| 0   sy  0   0 |
| 0   0   sz  0 |
| 0   0   0   1 |

Step 3: T(px, py, pz)

| 1  0  0  px |
| 0  1  0  py |
| 0  0  1  pz |
| 0  0  0  1  |

Multiplying Them Together

Multiply step by step. First, S(sx, sy, sz) · T(-px, -py, -pz):

| sx  0   0   -sx·px |
| 0   sy  0   -sy·py |
| 0   0   sz  -sz·pz |
| 0   0   0     1    |

Now pre-multiply by T(px, py, pz):

| 1  0  0  px | | sx  0   0   -sx·px |   | sx  0   0   px - sx·px |
| 0  1  0  py | | 0   sy  0   -sy·py | = | 0   sy  0   py - sy·py |
| 0  0  1  pz | | 0   0   sz  -sz·pz |   | 0   0   sz  pz - sz·pz |
| 0  0  0  1  | | 0   0   0     1    |   | 0   0   0      1       |

Final Combined Matrix

S' = | sx   0    0    px(1 - sx) |
     | 0    sy   0    py(1 - sy) |
     | 0    0    sz   pz(1 - sz) |
     | 0    0    0        1      |

Verification (applying to a point P(x, y, z))

x' = sx·x + px(1 - sx) = sx·x + px - sx·px = sx(x - px) + px
y' = sy·y + py(1 - sy) = sy(y - py) + py
z' = sz·z + pz(1 - sz) = sz(z - pz) + pz

This matches exactly what you'd expect intuitively: each coordinate is scaled relative to its distance from the fixed point (x − px), and then the fixed point's offset is added back, so the fixed point F(px, py, pz) itself stays exactly where it is (it maps to itself you can check by substituting x = px, y = py, z = pz, which gives x' = px, y' = py, z' = pz).

Example: F = (2, 2, 2), scale factors (0.5, 0.5, 0.5), point P = (4, 6, 2)

x' = 0.5(4) + 2(1 - 0.5) = 2 + 1 = 3
y' = 0.5(6) + 2(1 - 0.5) = 3 + 1 = 4
z' = 0.5(2) + 2(1 - 0.5) = 1 + 1 = 2

P' = (3, 4, 2) — matches the earlier step-by-step result exactly.


Properties of 3D Scaling

  1. Not a rigid-body transformation: Scaling changes the size of an object (and shape, if non-uniform), unlike translation and rotation.
  2. Inverse of scaling: The inverse of S(sx, sy, sz) is:

    S^-1(sx, sy, sz) = S(1/sx, 1/sy, 1/sz)

    This is only valid when none of the scale factors are zero (a zero scale factor collapses information and cannot be undone).

  3. Composition of successive scalings: Applying two scalings in sequence multiplies the corresponding scale factors:

    S(sx1, sy1, sz1) · S(sx2, sy2, sz2) = S(sx1·sx2, sy1·sy2, sz1·sz2)
  4. Commutativity: Scaling matrices about the same fixed point (or the origin) commute with each other:

    S(a) · S(b) = S(b) · S(a)
  5. Does not commute with translation or rotation in general: Scaling about the origin and then translating gives a different result than translating first and then scaling, since scaling stretches the distance from the origin, including the displacement introduced by translation.
  6. Determinant: The determinant of S(sx, sy, sz) is sx·sy·sz, which represents the volume scale factor how much the object's volume is multiplied by after scaling. For example, doubling all three scale factors increases volume by a factor of 2×2×2 = 8.

Solved Numerical Problems

Problem 1

A point P(2, 3, 4) is scaled using scale factors (2, 3, 1). Find the new coordinates.

Solution:

x' = x · sx = 2 × 2 = 4
y' = y · sy = 3 × 3 = 9
z' = z · sz = 4 × 1 = 4

New point P' = (4, 9, 4)

Problem 2

Find the scaling matrix for uniform scaling with factor 2.5, and use it to scale the point (4, -2, 6).

Solution:

Scaling matrix:

S(2.5, 2.5, 2.5) = | 2.5  0    0    0 |
                   | 0    2.5  0    0 |
                   | 0    0    2.5  0 |
                   | 0    0    0    1 |

Applying to point (4, -2, 6, 1):

x' = 2.5 × 4 = 10
y' = 2.5 × (-2) = -5
z' = 2.5 × 6 = 15

New point P' = (10, -5, 15)

Problem 3

A cube has a vertex at A(1, 1, 1) and the diagonally opposite vertex at B(3, 3, 3), centered about the origin's scaling reference. If it is scaled by factors (2, 2, 2) about the origin, find the new positions of A and B, and verify the volume scale factor matches sx·sy·sz.

Solution:

Scaled points:

A' = (1×2, 1×2, 1×2) = (2, 2, 2)
B' = (3×2, 3×2, 3×2) = (6, 6, 6)

Original edge length of cube = 3 - 1 = 2 units, so original volume = 2³ = 8 cubic units.

New edge length = 6 - 2 = 4 units, so new volume = 4³ = 64 cubic units.

Volume ratio = 64 / 8 = 8

Expected volume scale factor = sx · sy · sz = 2 × 2 × 2 = 8 ✓ Matches.

Problem 4

A triangle has a vertex at P(4, 6, 2). Scale this point by factors (0.5, 0.5, 0.5) about a fixed point F(2, 2, 2) instead of the origin.

Solution:

Step 1: Translate F to origin: subtract (2, 2, 2) from P:

P1 = (4-2, 6-2, 2-2) = (2, 4, 0)

Step 2: Scale by (0.5, 0.5, 0.5):

P2 = (2×0.5, 4×0.5, 0×0.5) = (1, 2, 0)

Step 3: Translate back by adding (2, 2, 2):

P3 = (1+2, 2+2, 0+2) = (3, 4, 2)

Final point P' = (3, 4, 2)

Note that if we had scaled about the origin directly instead, the result would have been (2, 3, 1) — a different (and incorrect, if the intention was to scale "in place" about F) location. This demonstrates why the fixed-point procedure matters.

Problem 5

A point P(1, 1, 1) is scaled by factors (-2, 1, 1). Describe what happens to the point geometrically, and find its new coordinates.

Solution:

x' = 1 × (-2) = -2
y' = 1 × 1 = 1
z' = 1 × 1 = 1

New point P' = (-2, 1, 1)

Geometric interpretation: Since sx is negative, the point (and the object it belongs to) is scaled by a factor of 2 along X and reflected across the YZ-plane (its X-coordinate flips sign). The Y and Z coordinates remain unaffected since their scale factors are +1.

Problem 6 (Practice — try it yourself)

A rectangular box has opposite corners at A(0, 0, 0) and B(4, 2, 6). Scale the box by factors (1.5, 2, 0.5) about the origin. Find the new position of corner B, compute the new volume of the box, and verify it matches the expected volume scale factor (sx × sy × sz) applied to the original volume.

(Hint: original volume = 4 × 2 × 6 = 48 cubic units.)


Conclusion

3D scaling completes the trio of fundamental transformations alongside translation and rotation. While conceptually straightforward multiply each coordinate by a scale factor its real-world use requires care: scaling about the wrong reference point can unintentionally shift an object's position, and non-uniform scaling can distort shapes unexpectedly. 

Mastering the "translate–scale–translate back" technique for scaling about an arbitrary fixed point is essential, as the same pattern reappears throughout 3D graphics, including in rotation about arbitrary axes.

Previous Post
3D Rotation
Next Post
Homogeneous Coordinates in 3D
0 people found this article helpful

Was this article helpful?