1. Definition
An affine transformation in 3D is a linear mapping that preserves points, straight lines, and planes, and allows translation, scaling, rotation, reflection, and shear of 3D objects.
- Affine transformations maintain parallelism of lines but not necessarily distances or angles.
- Represented conveniently using 4×4 matrices with homogeneous coordinates.
2. Homogeneous Coordinates in 3D
A 3D point (x,y,z) is represented in homogeneous coordinates as:
P=[x y z 1]
- Using 4×4 matrices allows translation to be expressed as matrix multiplication, along with rotation, scaling, and shear.
3. Types of 3D Affine Transformations
A. Translation
Moves a point by a vector (tx,ty,tz):
T=[100tx 010ty 001tz 0001],P′=T⋅P
B. Scaling
Scales coordinates along x, y, z axes:
S=[Sx000 0Sy00 00Sz0 0001],P′=S⋅P
- Sx,Sy,Sz>1 enlarges, 0<S<1 shrinks.
C. Rotation
Rotation about x, y, or z axes:
About X-axis (angle θ):
Rx=[1000 0cosθ−sinθ0 0sinθcosθ0 0001]
About Y-axis (angle θ):
Ry=[cosθ0sinθ0 0100 −sinθ0cosθ0 0001]
About Z-axis (angle θ):
Rz=[cosθ−sinθ00 sinθcosθ00 0010 0001]
D. Shear
Shifts one coordinate proportionally to another:
Sh=[1ShxyShxz0 Shyx1Shyz0 ShzxShzy10 0001]
4. Concatenation of 3D Affine Transformations
- Multiple transformations can be combined into a single matrix:
Mfinal=T⋅R⋅S⋅Sh
- Apply once to a point/vector:
P′=Mfinal⋅P
- Order matters (matrix multiplication is not commutative).
5. Summary Table
| Transformation |
Matrix Form |
Effect |
| Translation |
4×4 matrix with last column (tx,ty,tz,1) |
Move object in space |
| Scaling |
Diagonal 4×4 matrix |
Resize object along axes |
| Rotation |
4×4 matrix (Rx,Ry,Rz) |
Rotate object about axes |
| Shear |
Off-diagonal elements |
Skew object along axes |
Key Points:
- Affine transformations in 3D preserve straight lines and parallelism.
- Using homogeneous coordinates, translation, rotation, scaling, and shear can all be represented as matrix multiplication.
- Essential for 3D modeling, animation, and graphics pipelines.