Download presentation
Presentation is loading. Please wait.
2
Transformations I CS5600Computer Graphics by Rich Riesenfeld 27 February 2002 Lecture Set 5
3
CS5600 2 Transformations and Matrices Transformations are functions Matrices are functions representations Matrices represent linear transf’s
4
CS5600 3 What is a 2D Linear Transf ? Recall from Linear Algebra:
5
CS5600 4 Example: Scale in x
6
CS5600 5 Example: Scale in x by 2 What is the graphical view?
7
CS5600 6 Scale in x by 2
8
CS5600 7
9
8
10
9
11
10 Summary on Scale “Scale then add,” is same as “Add then scale”
12
CS5600 11 Matrix Representation Scale in x by 2:
13
CS5600 12 Matrix Representation Scale in y by 2:
14
CS5600 13 Matrix Representation Overall Scale by 2:
15
CS5600 14 Matrix Representation Showing Same
16
CS5600 15 What about Rotation? Is it linear?
17
CS5600 16 Rotate by
18
CS5600 17 Rotate by : 1 st Quadrant
19
CS5600 18 Rotate by : 1 st Quadrant
20
CS5600 19 Rotate by : 2 nd Quadrant
21
CS5600 20 Rotate by : 2 nd Quadrant
22
CS5600 21 Rotate by : 2 nd Quadrant
23
CS5600 22 Summary of Rotation by
24
CS5600 23 Summary (Column Form)
25
CS5600 24 Using Matrix Notation (Note that unit vectors simply copy columns)
26
CS5600 25 General Rotation by Matrix
27
CS5600 26 Who had linear algebra? Who understand matrices?
28
CS5600 27 What do the off diagonal elements do?
29
CS5600 28 Off Diagonal Elements
30
CS5600 29 Example 1 S
31
CS5600 30 Example 1 S
32
CS5600 31 Example 1 T(S)
33
CS5600 32 Example 2 S
34
CS5600 33 Example 2 S
35
CS5600 34 Example 2 T(S)
36
CS5600 35 Summary Shear in x: Shear in y:
37
CS5600 36 Double Shear
38
CS5600 37 Sample Points: unit inverses
39
CS5600 38 Geometric View of Shear in x
40
Another Geometric View of Shear in x 39
41
Another Geometric View of Shear in x 40
42
CS5600 41 Geometric View of Shear in y
43
Another Geometric View of Shear in y h h 42
44
Another Geometric View of Shear in y 43
45
CS5600 44 “Lazy 1”
46
CS5600 45 Translation in x
47
CS5600 46 Translation in x
48
CS5600 47 Homogeneous Coordinates
49
CS5600 48 Homogeneous Coordinates
50
CS5600 49 Homogeneous Coordinates Homogeneous term effects overall scaling
51
Homogeneous Coordinates An infinite number of points correspond to (x,y,1). They constitute the whole line (tx,ty,t). w = 1 (tx,ty,t) (x,y,1)
52
CS5600 51 We’ve got Affine Transformations Linear + Translation
53
CS5600 52 Compound Transformations Build up compound transformations by concatenating elementary ones Use for complicated motion Use for complicated modeling
54
CS5600 53 Elementary Transformations Scale Rotate Translate Shear (Reflect)
55
CS5600 54 Refection about y-axis
56
CS5600 55 Reflection about y-axis
57
CS5600 56 Reflection about x-axis
58
CS5600 57 Reflection about x-axis
59
Is Reflection “Elementary?” Can we effect reflection in an elementary way? (More elementary means scale, shear, rotation, translation.) 58
60
CS5600 59 Reflection is Scale (-1)
61
CS5600 60 Example:Move clock hands
62
CS5600 61 Example:Move clock hands
63
CS5600 62 Example:Move clock hands
64
CS5600 63 Example:Move clock hands
65
CS5600 64 Clock Transformations Translate to Origin Move hand with rotation Move hand back to clock Do other hand
66
CS5600 65 Clock Transformations
67
CS5600 66 Clock Transformations
68
CS5600 67 Map [a,b] [0,1] 0 [ ] ab 1
69
CS5600 68 Map [a,b] [0,1] Translate to Origin Map x to translated interval
70
CS5600 69 Map [a,b] [0,1] Normalize the interval Map x to normalized interval
71
CS5600 70 Map [a,b] [0,1]
72
CS5600 71 Just Look at This is a homogeneous form for 1D
73
CS5600 72 Map [a,b] [-1,1] 0 [ ] +1 a b
74
CS5600 73 Map [a,b] [-1,1] Translate center of interval to origin Normalize interval to [-1,1]
75
CS5600 74 Map [a,b] [-1,1] Substitute x =a (analogous for x =b) : x
76
CS5600 75 Now Map [a,b] [c,d] First map [a,b] to [0,1] –(We already did this) Then map [0,1] to [c,d]
77
CS5600 76 Now Map [a,b] [c,d] Scale [0,1] by (d-c) Then translate by c That is, in 1D homogeneous form:
78
CS5600 77 All Together: [a,b] [c,d]
79
CS5600 78 Now Map Rectangles
80
CS5600 79 Transformation in x and y
81
This is the Viewport Transformation Good for mapping objects from one coordinate system to another This is what we do with windows and viewports 80
82
CS5600 81 3D Transformations Scale Rotate Translate Shear
83
CS5600 82 3D Scale in x
84
CS5600 83 3D Scale in x
85
CS5600 84 3D Scale in y
86
CS5600 85 3D Scale in z
87
CS5600 86 Overall 3D Scale
88
CS5600 87 Overall 3D Scale Same in x,y and z:
89
What is a Positive Rotation in 3D ? Sit at end of given axis Look at Origin CC Rotation is in Positive direction 88
90
3D Positive Rotations
91
CS5600 90 3D Rotation about z-axis by We have already done this:
92
CS5600 91 3D Rotation about x-axis by
93
CS5600 92 3D Rotation about x-axis
94
3D Rotation about y-axis by 93
95
CS5600 94 3D Rotation about y-axis
96
CS5600 95 Elementary Transformations Scale Rotate Translate Shear (Reflect)
97
CS5600 96 Consider an arbitrary 3D rotation What is its inverse? What is its transpose? Can we constructively elucidate this relationship?
98
Want to rotate by about arbitrary axis a 97
99
CS5600 98 First rotate about by Now in the (y-z)-plane
100
CS5600 99 Then rotate about by Rotate in the (y-z)-plane
101
Now perform rotation about - Now aligned with z-axis 100
102
Now perform rotation about - Now aligned with z-axis 101
103
CS5600 102 Then rotate about by Rotate again in the (y-z)-plane
104
CS5600 103 Then rotate about by Now to original position of a
105
We effected a rotation by about arbitrary axis a 104
106
We effected a rotation by about arbitrary axis a 105
107
CS5600 106 Rotation about an arbitrary axis Rotation about a-axis can be effected by a composition of 5 elementary rotations We show arbitrary rotation as succession of 5 rotations about principal axes
108
CS5600 107 In matrix terms,
109
CS5600 108 Similarly, so,
110
CS5600 109 Recall, Consequently, for because,
111
CS5600 110 It follows directly that,
112
CS5600 111
113
CS5600 112 Constructively, we have shown, This will be useful later
114
CS5600 113 3D Translation in x
115
CS5600 114 3D Translation in y
116
CS5600 115 3D Translation in z
117
CS5600 116 3D Shear in x -direction
118
CS5600 117 3D Shear in x -direction
119
CS5600 118 3D Shears:clamp a principal plane, shear in other 2 DoFs
121
CS5600 120 3D Shear in y -direction
122
CS5600 121 3D Shear in y -direction
124
CS5600 123 3D Shear in z -direction
125
CS5600 124 3D Shear in z
126
CS5600 125 3D Shear in z
127
CS5600 126 What is “Perspective?” A mechanism for portraying 3D in 2D “True Perspective” corresponds to projection onto a plane “True Perspective” corresponds to an ideal camera image
128
Many Kinds of Perspective Used Mechanical Engineering Cartography Art
129
CS5600 128 Perspective in Art Naïve (wrong) Egyptian Cubist (unrealistic) Esher –Impossible (exploits local property) –Hyperpolic (non-planar) –etc
130
CS5600 129 “True” Perspective in 2D (x,y) p h
131
CS5600 130 “True” Perspective in 2D
132
CS5600 131 “True” Perspective in 2D This is right answer for screen projection
133
CS5600 132 “True” Perspective in 2D
134
End Transformations I Lecture Set 5 133
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.