Download presentation
Presentation is loading. Please wait.
1
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation
2
Coordinate systems left handedright handed
3
Transformation 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
4
Transformations 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
5
Basic transformations Translation (shift) Scaling Rotation
6
Translation T = (Tx,Ty,Tz) x’ = x + Tx y’ = y + Ty z’ = z + Tz X Y Z A B C D A B C D
7
Scaling about the origin X Z Y A B C D A B C D x’ = x * Sx y’ = y * Sy z’ = z * Sz S > 1- enlarge 0 < S < 1- reduce S < 0 - mirror
8
Scaling about an arbitrary point Scaling about a fixed point ( x c, y c, z c ) x' = x c + ( x – x c ) * Sx y' = x c + ( y – y c ) * Sy z' = z c + ( z – z c ) * Sz Can also be achieved by a composite transformation.
9
Rotation The direction of rotation in the left-handed system Positive angle of rotation when looking from a positive axis toward the origin a 90 o clockwise rotation transforms one positive axis into the other.
10
Positive angle of rotation for Z axis Y X Looking from the positive end of Z axis towards the origin
11
Rotation Axis of rotation is Direction of positive rotation is Xfrom Y to Z Yfrom Z to X Zfrom X to Y
12
A C D B Rotation about Z axis X Y Z A B C D x' = x·cos - y·sin y' = x·sin + y·cos z' = z
13
Rotation about X axis y' = y·cos - z·sin z' = y·sin + z·cos x' = x X Y Z A B C D A B C D
14
Rotation about Y axis z' = z·cos - x·sin x' = z·sin + x·cos y' = y X Y Z B C D A A B C D
15
Rotation 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
16
Matrix representation Homogeneous coordinates common notation for ALL transformations common computational mechanism for ALL transformations simple mechanism for combining a number of transformations => computational efficiency
17
Common matrix operation for all transformations??? Translate (shift) point P Scale point P Rotate point P Point (vector) P = [ x p y p z p ] Matrix ???
18
Homogeneous coordinates Point P = (x, y, z ) represented by a vector P = Transformations All represented by a 4 x 4 matrix T T =
19
Point transformation in homogeneous coordinates Implemented by matrix multiplication P’ = T · P
20
Transformation matrices for elementary transformations 4 x 4 matrix Homogeneous coordinates Translation, scaling, rotation and perspective projection, all defined through matrices
21
Translation x’ = x + Tx y’ = y + Ty z’ = z + Tz T =
22
Scaling x’ = x * Sx y’ = y * Sy z’ = z * Sz S =
23
Rotation about Z axis x' = x·cos - y·sin y' = x·sin + y·cos z' = z Rz =
24
Rotation about X axis y' = y·cos - z·sin z' = y·sin + z·cos x' = x Rx =
25
Rotation about Y axis z' = z·cos - x·sin x' = z·sin + x·cos y' = y Ry =
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.