3-D Transformations
3-D Transformations
3D Transformations
1
3D Coordinate System
• 3D computer graphics involves the additional dimension of
depth, allowing more realistic representations of 3D objects in
the real world
2
3D Transformation
• The translation, scaling and rotation transformations used for 2D can be
extended to three dimensions
original
(20,35,10)
x x t x
y y t y
(45,30, 18)
(65,30,20)
z ' z tz
7
Scaling
8
Rotation: Rotating in 3D
• Cannot do mindless conversion like before
• Why?
• Rotate about what axis?
• 3D rotation: about a defined axis
• Different Xform matrix for:
• Rotation about x-axis
• Rotation about y-axis
• Rotation about z-axis
9
Rotating in 3D
• New terminology
• X-roll: rotation about x-axis
• Y-roll: rotation about y-axis
• Z-roll: rotation about z-axis
• Which way is +ve rotation
• Look in –ve direction (into +ve arrow)
• CCW is +ve rotation
+ x
z
10
3D Rotation
11
Fig: 3D Rotation
Coordinate
•
Axis Rotations
Obtain rotations around other axes through cyclic
permutation of coordinate parameters:
x' x
y ' y cos θ z sin θ
z ' y sin θ z cos θ
Fig: Reflection 16
3D Reflection
17
3D Reflection
18
Shearing
• A Transformation that distorts the shape of an object such
that the transformed shape appears as if the object were
decomposed of internal layers that had been caused to slide
over each other is called a shearing
• In 2-D, transformations relative to X or Y axis to produce
distortion in the shapes of objects. In 3-D, we can also
generate shears relative to Z-axis.
19
Shearing
• Modify object shapes
• Useful for perspective projection:
• Draw a cube (3D) on a screen (2D)
• Alter the values of x and y by an amount proportional to the
distance from Z ref.
• Shearing factors: Shx, Shy, Shz
20
Shearing
•Shearing along x-axis: only change with y and z coordinate
21
Shearing
•Shearing along y-axis: only change with x and z coordinate
22
Shearing
•Shearing along z-axis: only change with x and y coordinate
23
Composite 3D Transformations
Same way as in two dimensions:
Multiply matrices
Rightmost term in matrix product is the first
transformation to be applied
24
.
Thank You
25