Unit 3: Transformations - Computer Graphics Notes - CSU358

Unit 3: 2D & 3D Transformations

3.1 The Basic Transformations (2D)

Analogy: Think of looking at a photo on your phone.

1. Translation (Moving)

Adding a value to move the point.

2. Scaling (Resizing)

Multiplying to stretch or shrink.

3. Rotation (Spinning)

Rotating about the Origin $(0,0)$.

mindmap
  root((2D Moves))
    Translation
      Move
      Add (T)
    Scaling
      Resize
      Multiply (S)
    Rotation
      Spin
      Trig (Cos/Sin)
            

3.2 Reflection & Shearing

Reflection (Mirroring)

Flipping an object. It changes the "handedness".

Axis Concept Result
X-Axis Mirror on the ground. $(x, -y)$
Y-Axis Mirror on the wall. $(-x, y)$
Origin Mirror in the corner. $(-x, -y)$
Line $y=x$ Diagonal mirror. $(y, x)$

Shearing (Slanting)

Analogy: Pushing the top of a deck of cards sideways.
mindmap
  root((Mirror & Slant))
    Reflection
      Flip Signs
      Change Handedness
    Shear
      Push Top/Side
      Deform Shape
            

3.3 3D Transformations

Same concepts as 2D, but with a Z-axis. Points become $(x, y, z)$.

Exam Note: Remember these explicit formulas for 3D logic.

1. 3D Translation

$$x' = x + t_x, \quad y' = y + t_y, \quad z' = z + t_z$$

2. 3D Scaling

$$x' = x \cdot s_x, \quad y' = y \cdot s_y, \quad z' = z \cdot s_z$$

3. 3D Rotation (The Tricky Part)

Rotation happens around an axis.

mindmap
  root((3D Space))
    Concept
      Add Z-Axis
      Depth
    3D Rotation
      About Z (Standard)
      About X (Tilt)
      About Y (Pan)
            

3.4 Composite & Affine Transformations

Homogeneous Coordinates

Add a dummy coordinate to enable matrix multiplication: $(x, y) \to (x, y, 1)$ or $(x,y,z,1)$.

Composite Rule

Matrix multiplication is NOT commutative ($A \cdot B \neq B \cdot A$). Multiply Right-to-Left.

Common Recipes

A. Pivot Point Rotation

Formula: $T^{-1} \cdot R \cdot T$
  1. Translate Pivot to Origin.
  2. Rotate.
  3. Inverse Translate back.

B. Fixed Point Scaling

Same Recipe: $T^{-1} \cdot S \cdot T$.

Rigid vs. Non-Rigid Body

mindmap
  root((Composite Logic))
    Rules
      Right-to-Left
      Homogeneous (1)
    Pivot Point
      1. Move to Origin
      2. Rotate
      3. Move Back
    Scaling
      Same steps
      Fixed Point
            

3.5 Advanced Concepts

Reflection About Arbitrary Line ($y = mx + c$)

The 5-Step Logic:
  1. Translate line to pass through Origin.
  2. Rotate line to align with X-axis.
  3. Reflect about X-axis.
  4. Inverse Rotate.
  5. Inverse Translate.

Rapid-Fire Formulas (Exam Tricks)

Quick tips:

mindmap
  root((Advanced Magic))
    Arbitrary Reflection
      5-Step Algo
      Move -> Rot -> Ref -> InvRot -> InvMove
    Shortcuts
      Inverse = Negate
      y=k line Reflection