Download presentation
Presentation is loading. Please wait.
Published byErin Briggs Modified over 9 years ago
1
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk ozturk@ube.ege.edu.tr http://ube.ege.edu.tr/~ozturk
2
Two Dimensional Geometric Transformations
3
Basic Transformations Translation P P'P' x y
4
Basic Transformations Rotation x y θ φ P′=(x′,y′) r
5
Rotation (Cont.) Basic Transformations
6
Scaling x y Basic Transformations
7
3x3 Matrix Representations We can combine the multiplicative and translational terms for 2D transformations into a single matrix representation by expanding the 2x2 matrix representations to 3x3 matrices. This allows us to express all transformation equations as matrix multiplications.
8
Homogeneous Coordinates We represent each Cartesian coordinate position (x,y) with the homogeneous coordinate triple where
9
Homogeneous Coordinates(cont.) Thus, a general homogeneous coordinate representation can also be written as For 2D transformations we choose h=1. Each 2D position is represented with homogeneous coordinates
10
Translation in homogeneous coordinates
11
Rotation in homogeneous coordinates
12
Scaling in homogeneous coordinates
13
Composite Transformations:Translation If two successive translation are applied to a point P, then the final transformed location P' is calculated as
14
Composite Transformations:Rotation
15
Composite Transformations:Scalings
16
General Pivot Point Rotation Steps: -Translate the object so that the pivot point is moved to the coordinate origin. -Rotate the object about the origin. -Translate the object so that the pivot point is returned to its original position.
17
General Pivot Point Rotation(Cont.)
19
General Fixed Point Scaling Steps: -Translate the object so that the fixed point coincides with the coordinate origin. -Scale the object about the origin. -Translate the object so that the pivot point is returned to its original position.
20
General Fixed Point Scaling (x r, y r )
21
General Fixed Point Scaling
22
Concatenation Properties Matrix multiplication is associative Transformation product is not commutative
23
OTHER TRANSFORMATIONS Reflection About x-axis About y-axis x y 1 23 23 1
24
OTHER TRANSFORMATIONS x y 1 2 3 2 1 3 Reflection about the origin
25
OTHER TRANSFORMATIONS Reflection about the line y=x. x y 2 2 1 3 y = x 2 3
26
OTHER TRANSFORMATIONS Shear x-direction shear xx yy
27
TRANSFORMATION BETWEEN COORDINATE SYSTEMS Individual objects may be defined in their local cartesian reference system. The local coordinates must be transformed to position the objects within the scene coordinate system.
28
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) Steps for coordinate transformation -Translate so that the origin (x 0, y 0 ) of the x′-y′ system is moved to the origin of the x-y system. -Rotate the x′ axis on to the axis x.
29
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x x′ y′ θ x0x0 y0y0 0
30
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x x′ x0x0 y0y0 0 y′ θ
31
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x x′ x0x0 y0y0 0 y′
32
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.)
33
An alternative method: - Specify a vector V that indicates the direction for the positive y′ axis. Let - Obtain the unit vector u=(u x,u y ) along the x′ axis by rotating v 90 0 clockwise.
34
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) - Elements of any rotation matrix can be expressed as elements of orhogonal unit vectors. That is, the rotation matrix can be written as
35
TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x x′ y′ x0x0 y0y0 0 V
36
Three Dimensional Geometric Transformations
37
P=(x,y,z) x 3D Translation P′=(x′,y′,z′) y z
38
3D Translation
39
3D Rotation(z-axis) z-axis rotation P=(x,y,z) x y z
40
3D Rotation(z-axis)
41
x-axis rotation P=(x,y,z) x y z 3D Rotation(x-axis)
43
y-axis rotation P=(x,y,z) x y z 3D Rotation(y-axis)
45
General 3D Rotation Rotation about an axis that is parallel to x-axes. -Translate object so that the rotation axis coincides with the parallel coordinate axis. -Perform specified rotation about the axis. -Translate the object so that the rotation axis is moved back to its original position.
46
Rotation about an axis that is parallel to x-axes. Rotation axis x y z
47
General 3D Rotation Rotation about an axis that is not parallel to one of the coordinate axes. -Translate object so that the rotation axis passes through the coordinate origin. -Rotate object so that the axis of rotation coincides with one of the coordinate axes. -Perform the specified rotation about that coordinate axis -Apply inverse rotations to bring the rotation axis back to its original orientation. -Apply the inverse translation to brig the rotation axis back to its original position.
48
Rotation about an axis that is not parallel to one of the coordinate axes. Rotation axis x y z P2P2 P1P1 Initial Position
49
Rotation about an axis that is not parallel to one of the coordinate axes. x y z P2P2 P1P1 Translate P 1 to the origin
50
Rotation about an axis that is not parallel to one of the coordinate axes. x y z P2P2 P1P1 Rotate P 2 onto the z-axis and rotate the object around it.
51
Rotation about an axis that is not parallel to one of the coordinate axes. x y z P2P2 P1P1 Rotate the axis to the original orientation
52
Rotation about an axis that is not parallel to one of the coordinate axes. x y z P2P2 P1P1 Translate the rotation axis to the original position
53
Rotation about an axis that is not parallel to one of the coordinate axes. An axis vector is defined by two points as A unit vector is defined as
54
Rotation about an axis that is not parallel to one of the coordinate axes. The first step is to set up the translation matrix
55
Rotation about an axis that is not parallel to one of the coordinate axes. The next step is to put the rotation axis on the z-axis. x y z u
56
Rotation about an axis that is not parallel to one of the coordinate axes. First, we rotate about the x-axis to transform u into the x-z plane. x y z u α
57
Rotation about an axis that is not parallel to one of the coordinate axes. First, we rotate about the x-axis to transform u into the x-z plane. x y z u α u′u′ U z =(0,0,1) α
58
Rotation about an axis that is not parallel to one of the coordinate axes. We can define the sine of α from the cross product of u and u′.
59
Rotation about an axis that is not parallel to one of the coordinate axes. The rotation matrix is
60
Rotation about an axis that is not parallel to one of the coordinate axes. x y z u β
61
Rotation about an axis that is not parallel to one of the coordinate x-axes.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.