Title: Elementary 3D Transformations a "Graphics Engine"
1Elementary 3D Transformations - a "Graphics
Engine"
- Transformation procedures
- Transformations of coordinate systems
- Translation
- Scaling
- Rotation
2Coordinate systems
left handed right handed
3Transformation procedures
- A scene is made up of objects
- Objects can be made of separately defined parts
- Each object / part defined by a list of points
(vertices) - Any part of the object can be moved or distorted
by applying a transformation to the list of
points which define it
4Transformations of coordinate system
- Separate coordinate systems for different objects
- Common (Word) coordinate system for the scene
- Building a scene - transformation to the Word
coordinate system
5Basic transformations
- Translation (shift)
- Scaling
- Rotation
6Translation
x x Tx y y Ty z z Tz
T (Tx,Ty,Tz)
7Scalingabout the origin
x x Sx y y Sy z z Sz S gt 1 -
enlarge 0 lt S lt 1 - reduce S lt 0 - mirror
Y
Z
X
8Scalingabout an arbitrary point
Scaling about a fixed point ( xc, yc, zc ) x'
xc ( x xc ) Sx y' xc ( y yc )
Sy z' zc ( z zc ) Sz Can also be
achieved by a composite transformation.
9Rotation
- The direction of rotation in the left-handed
system - Positive angle of rotation
- when looking from a positive axis toward the
origin - a 90o clockwise rotation transforms one positive
axis into the other.
10Positive angle of rotation for Z axis
Looking from the positive end of Z axis towards
the origin
11Rotation
- Axis of rotation is Direction of positive
rotation is - X from Y to Z
- Y from Z to X
- Z from X to Y
12Rotation about Z axis
Y
Z
- x' xcos ? - ysin ?
- y' xsin ? ycos ?
- z' z
X
13Rotation about X axis
Y
Z
- y' ycos ? - zsin ?
- z' ysin ? zcos ?
- x' x
X
14Rotation about Y axis
Y
- z' zcos? - xsin?
- x' zsin? xcos?
- y' y
Z
X
15Rotation about any fixed point
- 1. Translate the object so that the rotation axis
coincides with the parallel coordinate axis - 2. Perform the specified rotation
- 3. Translate the object so that the rotation axis
is moved back to its original position
16Matrix representationHomogeneous coordinates
- common notation for ALL transformations
- common computational mechanism for ALL
transformations - simple mechanism for combining a number of
transformations gt computational efficiency
17Common matrix operation for all transformations???
- Translate (shift) point P
- Scale point P
- Rotate point P
- Point (vector) P xp yp zp
- Matrix ???
18Homogeneous coordinates
- Point P (x, y, z ) represented by a vector
-
- P
- Transformations
- All represented by a 4 x 4 matrix T
T
19Point transformation in homogeneous coordinates
- Implemented by matrix multiplication
- P T P
20Transformation matrices for elementary
transformations
- 4 x 4 matrix
- Homogeneous coordinates
- Translation, scaling, rotation and perspective
projection, all defined through matrices
21Translation
22Scaling
23Rotation about Z axis
- x' xcos ? - ysin ?
- y' xsin ? ycos ?
- z' z
- Rz
24Rotation about X axis
- y' ycos ? - zsin ?
- z' ysin ? zcos ?
- x' x
- Rx
25Rotation about Y axis
- z' zcos? - xsin?
- x' zsin? xcos?
- y' y
- Ry