2D Geometric Transformations for Computer Graphics

 
CSE 411
 
Computer Graphics
 
Lecture #
6 2D Geometric Transformations
 
 
Prepared & Presented by Asst. Prof. Dr. Samsun M. BAŞARICI
 
O
b
j
e
c
t
i
v
e
s
 
HB Ch. 7, GVS Ch. 3
Basic 2D Transformations (rigid-body
transformations):
Translation
Rotation
Scaling
Homogenenous Representations and
Coordinates
2D Composite Transformations
 
2
 
2D Geometric Transformations
 
O
b
j
e
c
t
i
v
e
s
 
(
c
o
n
t
.
)
 
Other Transformations:
Reflection
Shearing
Raster Methods for Transformations and
OpenGL
Transformations between 2D Coordinate
Systems and OpenGL
 
 
 
3
 
2D Geometric Transformations
G
e
o
m
e
t
r
i
c
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
Sometimes also called modeling
transformations
Geometric transformations: 
Changing an object’s
position (translation), orientation (rotation) or size
(scaling)
Modeling transformations: Constructing a scene
or hierarchical description of a complex object
Others transformations: reflection and
shearing operations
4
2D Geometric Transformations
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
2D Translation
 
 
 
    x’ = x + t
x 
, y’ = y + t
y
 
 
 
P’=P+T
Translation moves the object without deformation
(rigid-body transformation)
5
2D Geometric Transformations
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
2D Translation
To move a line segment, apply the transformation
equation to each of the two line endpoints and
redraw the line between new endpoints
To move a polygon, apply the transformation
equation to coordinates of each vertex and
regenerate the polygon using the new set of vertex
coordinates
 
 
 
 
 
6
2D Geometric Transformations
 
2
D
 
T
r
a
n
s
l
a
t
i
o
n
 
R
o
u
t
i
n
e
 
 class wcPt2D {
      public:
         GLfloat x, y;
   };
 
   void translatePolygon (wcPt2D * verts, GLint nVerts, GLfloat tx, GLfloat ty)
   {
      GLint k;
 
      for (k = 0; k < nVerts; k++) {
         verts [k].x = verts [k].x + tx;
         verts [k].y = verts [k].y + ty;
      }
      glBegin (GL_POLYGON);
         for (k = 0; k < nVerts; k++)
            glVertex2f (verts [k].x, verts [k].y);
      glEnd ( );
   }
 
7
 
2D Geometric Transformations
 
2D Rotation
Rotation axis
Rotation angle
rotation point or pivot point (x
r
,y
r
)
y
r
x
r
θ
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
8
2D Geometric Transformations
 
2D Rotation
If
 θ 
is positive 
 counterclockwise rotation
If 
θ 
is negative 
 clockwise rotation
Remember:
cos(
a 
+
 b
) = cos 
a
 cos 
b
 - sin 
a
 sin 
b
cos(
a - b
) = cos 
a
 
sin
 
b
 
+
 sin 
a
 
cos
 
b
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
9
 
2D Geometric Transformations
 
2D Rotation
At first, suppose the pivot point is at the origin
   x’=r cos(θ+Φ) = r cos θ cos Φ - r sin θ sin Φ
 
   y’=r sin(θ+Φ) = r cos θ sin Φ + r sin θ cos Φ
   x = r cos Φ, y = r sin Φ
   x’=x cos θ - y sin θ
 
   y’=x sin θ + y cos θ
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
10
 
2D Geometric Transformations
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
2D Rotation
P’=R·P
 
11
 
2D Geometric Transformations
 
2D Rotation
Rotation of a point about any specified position
(x
r
,y
r
)
 
x’=x
r
+(x - x
r
) cos θ – (y - y
r
) sin θ
 
y’=y
r
+(x - x
r
) sin θ + (y - y
r
) cos θ
Rotations also move objects without deformation
A line is rotated by applying the rotation formula to
each of the endpoints and redrawing the line
between the new end points
A polygon is rotated by applying the rotation
formula to each of the vertices and redrawing the
polygon using new vertex coordinates
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
12
2D Geometric Transformations
 
2
D
 
R
o
t
a
t
i
o
n
 
R
o
u
t
i
n
e
 
  class wcPt2D {
      public:
         GLfloat x, y;
   };
 
   void rotatePolygon (wcPt2D * verts, GLint nVerts, wcPt2D pivPt, GLdouble theta)
   {
      wcPt2D * vertsRot;
      GLint k;
 
      for (k = 0; k < nVerts; k++) {
         vertsRot [k].x = pivPt.x + (verts [k].x - pivPt.x) * cos (theta) - (verts [k].y - pivPt.y) *
sin (theta);
         vertsRot [k].y = pivPt.y + (verts [k].x - pivPt.x) * sin (theta) + (verts [k].y - pivPt.y) *
cos (theta);
      }
 
      glBegin 
(
GL_POLYGON
)
;
         for (k = 0; k < nVerts; k++)
            glVertex2f (vertsRot [k].x, vertsRot [k].y);
      glEnd ( );
   }
 
13
 
2D Geometric Transformations
 
2D Scaling
Scaling is used to alter the size of an object
Simple 2D scaling is performed by multiplying
object positions (x,
 
y) by scaling factors s
x
 and s
y
 
x’ = x · s
x
 
y’ = y · s
x
 
 
 
 
 
or P’ = S·P
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
14
 
2D Geometric Transformations
 
2D Scaling
Any positive value can be used as scaling factor
Values less than 1 reduce the size of the object
Values greater than 1 enlarge the object
If scaling factor is 1 then the object stays unchanged
If 
s
x 
= s
y 
, we call it 
uniform scaling
If scaling factor <1, then the object moves closer to the
origin and If scaling factor >1, then the object moves
farther from the origin
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
15
 
2D Geometric Transformations
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
16
2D Geometric Transformations
 
2D Scaling
W
e
 
c
a
n
 
c
o
n
t
r
o
l
 
t
h
e
 
l
o
c
a
t
i
o
n
 
o
f
 
t
h
e
 
s
c
a
l
e
d
 
o
b
j
e
c
t
 
b
y
c
h
o
o
s
i
n
g
 
a
 
p
o
s
i
t
i
o
n
 
c
a
l
l
e
d
 
t
h
e
 
f
i
x
e
d
 
p
o
i
n
t
 
(
x
f
,
y
f
)
x
 
 
x
f
 
=
 
(
x
 
 
x
f
)
 
s
x
y
 
 
y
f
 
=
 
(
y
 
 
y
f
)
 
s
y
 
 
x’=x · s
x 
+ x
f 
(1 – s
x
)
 
y’=y · s
y 
+ y
f 
(1 – s
y
)
Polygons are scaled by applying the above formula
to each vertex, then regenerating the polygon using
the transformed vertices
 
B
a
s
i
c
 
2
D
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
17
 
2D Geometric Transformations
 
2
D
 
S
c
a
l
i
n
g
 
R
o
u
t
i
n
e
 
 class wcPt2D {
      public:
         GLfloat x, y;
   };
   void scalePolygon (wcPt2D * verts, GLint nVerts, wcPt2D fixedPt, GLfloat sx,
GLfloat sy)
   {
      wcPt2D vertsNew;
      GLint k;
 
      for (k = 0; k < n; k++) {
         vertsNew [k].x = verts [k].x * sx + fixedPt.x * (1 - sx);
         vertsNew [k].y = verts [k].y * sy + fixedPt.y * (1 - sy);
      }
      glBegin 
(
GL_POLYGON
)
;
         for (k = 0; k < n; k++)
            glVertex2v (vertsNew [k].x, vertsNew [k].y);
      glEnd ( );
   }
 
18
 
2D Geometric Transformations
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
Many graphics applications involve
sequences of geometric transformations
Animations
Design and picture construction applications
We will now consider matrix representations
of these operations
Sequences of transformations can be efficiently
processed using matrices
19
2D Geometric Transformations
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
 
P’ = M
1 
· P + M
2
P and P’ are column vectors
M
1
 is a 2 by 2 array containing multiplicative
factors
M
2
 is a 2 element column matrix containing
translational terms
For translation M
1
 is the identity matrix
For rotation or scaling, M
2
 contains the
translational terms associated with the pivot point
or scaling fixed point
 
20
2D Geometric Transformations
 
To produce a sequence of operations, such
as scaling followed by rotation then
translation, we could calculate the
transformed coordinates one step at a time
A more efficient approach is to combine
transformations, without calculating
intermediate coordinate values
 
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
21
2D Geometric Transformations
 
Multiplicative and translational terms for a 2D
geometric transformation can be combined
into a single matrix if we expand the
representations to 3 by 3 matrices
We can use the third column for translation terms,
and all transformation equations can be
expressed as matrix multiplications
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
22
2D Geometric Transformations
 
E
x
p
a
n
d
 
e
a
c
h
 
2
D
 
c
o
o
r
d
i
n
a
t
e
 
(
x
,
y
)
 
t
o
 
t
h
r
e
e
e
l
e
m
e
n
t
 
r
e
p
r
e
s
e
n
t
a
t
i
o
n
 
(
x
h
,
y
h
,
h
)
 
c
a
l
l
e
d
h
o
m
o
g
e
n
e
o
u
s
 
c
o
o
r
d
i
n
a
t
e
s
h
 
i
s
 
t
h
e
 
h
o
m
o
g
e
n
e
o
u
s
 
p
a
r
a
m
e
t
e
r
 
s
u
c
h
 
t
h
a
t
x
 
=
 
x
h
/
h
,
 
y
 
=
 
y
h
/
h
,
 infinite homogeneous representations for a
point
A convenient choice is to choose h = 1
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
23
2D Geometric Transformations
 
2D Translation Matrix
 
 
 
 
 
o
r
,
 
P
 
=
 
T
(
t
x
,
t
y
)
·
P
 
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
 
24
 
2D Geometric Transformations
 
2D Rotation Matrix
 
 
 
 
 
o
r
,
 
P
 
=
 
R
(
θ
)
·
P
 
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
 
25
 
2D Geometric Transformations
 
2D Scaling Matrix
 
 
 
 
 
o
r
,
 
P
 
=
 
S
(
s
x
,
s
y
)
·
P
 
M
a
t
r
i
x
 
R
e
p
r
e
s
e
n
t
a
t
i
o
n
s
 
a
n
d
H
o
m
o
g
e
n
e
o
u
s
 
C
o
o
r
d
i
n
a
t
e
s
 
(
c
o
n
t
.
)
 
26
 
2D Geometric Transformations
 
I
n
v
e
r
s
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
2D Inverse Translation Matrix
 
 
 
 
By the way:
 
27
 
2D Geometric Transformations
 
I
n
v
e
r
s
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
2D Inverse Rotation Matrix
 
 
 
 
And also:
 
28
 
2D Geometric Transformations
I
n
v
e
r
s
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
2D Inverse Rotation Matrix
:
If 
θ
 is negative 
 clockwise
In
 
Only sine function is affected
Therefore we can say
 
 
Is that true?
Proof: It’s up to you 
29
2D Geometric Transformations
 
I
n
v
e
r
s
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
2D Inverse Scaling Matrix
 
 
 
 
 
Of course:
 
30
 
2D Geometric Transformations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
W
e
 
c
a
n
 
s
e
t
u
p
 
a
 
s
e
q
u
e
n
c
e
 
o
f
 
t
r
a
n
s
f
o
r
m
a
t
i
o
n
s
a
s
 
a
 
c
o
m
p
o
s
i
t
e
 
t
r
a
n
s
f
o
r
m
a
t
i
o
n
 
m
a
t
r
i
x
 
b
y
c
a
l
c
u
l
a
t
i
n
g
 
t
h
e
 
p
r
o
d
u
c
t
 
o
f
 
t
h
e
 
i
n
d
i
v
i
d
u
a
l
t
r
a
n
s
f
o
r
m
a
t
i
o
n
s
P’=M
2
·M
1
·P
 
   =M·P
 
 
 
 
31
2D Geometric Transformations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
 
Composite 2D Translations
If two successive translation are applied to a point P
,
then the final transformed location P
'
 
is calculated as
 
 
 
 
32
2D Geometric Transformations
Composite 2D Rotations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
33
2D Geometric Transformations
Composite 2D Scaling
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
34
2D Geometric Transformations
 
Don’t forget:
Successive translations are additive
Successive scalings are multiplicative
For example: If we triple the size of an object
twice, the final size is nine (9) times the original
9 times?
Why?
Proof: Again up to you 
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
35
2D Geometric Transformations
G
e
n
e
r
a
l
 
P
i
v
o
t
 
P
o
i
n
t
 
R
o
t
a
t
i
o
n
 
Steps:
1.
Translate the object so that the pivot point is
moved to the coordinate origin.
2.
Rotate the object about the origin.
3.
Translate the object so that the pivot point is
returned to its original position.
36
2D Geometric Transformations
G
e
n
e
r
a
l
 
P
i
v
o
t
 
P
o
i
n
t
 
R
o
t
a
t
i
o
n
37
2D Geometric Transformations
 
General 2D Pivot-Point Rotation
 
 
 
 
 
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
 
38
 
2D Geometric Transformations
G
e
n
e
r
a
l
 
F
i
x
e
d
 
P
o
i
n
t
 
S
c
a
l
i
n
g
 
Steps:
1.
Translate the object so that the fixed point
coincides with the coordinate origin.
2.
Scale the object about the origin.
3.
Translate the object so that the pivot point is
returned to its original position.
39
2D Geometric Transformations
G
e
n
e
r
a
l
 
F
i
x
e
d
 
P
o
i
n
t
 
 
S
c
a
l
i
n
g
(
c
o
n
t
.
)
 
l
(
x
r
,
 
y
r
)
 
(
x
r
,
 
y
r
)
40
2D Geometric Transformations
 
General 2D Fixed-Point Scaling:
 
G
e
n
e
r
a
l
 
F
i
x
e
d
 
P
o
i
n
t
 
 
S
c
a
l
i
n
g
(
c
o
n
t
.
)
 
41
 
2D Geometric Transformations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
 
General 2D scaling directions:
Above: scaling parameters were along 
x 
and 
y
directions
What about arbitrary directions?
Answer: See next slides
42
2D Geometric Transformations
 
G
e
n
e
r
a
l
 
2
D
 
S
c
a
l
i
n
g
 
D
i
r
e
c
t
i
o
n
s
 
Scaling parameters 
s
1
 and 
s
2
 along orthogonal directions defined by the
angular displacement 
θ
.
 
43
 
2D Geometric Transformations
 
G
e
n
e
r
a
l
 
2
D
 
S
c
a
l
i
n
g
 
D
i
r
e
c
t
i
o
n
s
(
c
o
n
t
.
)
 
44
 
2D Geometric Transformations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
 
Matrix Concatenation Properties:
Matrix multiplication is associative !
  
M
3
· M
2
· M
1
= (M
3
· M
2 
)
 
· M
1 
= M
3
· ( M
2 
· M
1 
)
A composite matrix can be created by multiplicating left-
to-right (premultiplication) or right-to-left
(postmultiplication)
M
a
t
r
i
x
 
m
u
l
t
i
p
l
i
c
a
t
i
o
n
 
i
s
 
n
o
t
 
c
o
m
m
u
t
a
t
i
v
e
 
!
M
2 
· M
1 
≠ M
1 
· M
2
45
2D Geometric Transformations
2
D
 
C
o
m
p
o
s
i
t
e
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
(
c
o
n
t
.
)
 
Matrix Concatenation Properties:
But:
Two successive rotations
Two successive translations
Two successive scalings
a
r
e
 
c
o
m
m
u
t
a
t
i
v
e
!
Why?
Proof: You got it: Up to you 
 
46
2D Geometric Transformations
 
R
e
v
e
r
s
i
n
g
 
t
h
e
 
o
r
d
e
r
 
in which a sequence of transformations is performed may affect the transformed
position of an object.
In (a), an object is first translated in the x direction, then rotated counterclockwise
through an angle of 45°.
In (b), the object is first rotated 45° counterclockwise, then translated in the 
x
direction
 
47
 
2D Geometric Transformations
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
Reflection
Transformation that produces a mirror image of an
object
 
48
 
2D Geometric Transformations
 
Reflection
Image is generated relative to an axis of reflection
by rotating the object 180° about the reflection
axis
Reflection about the line y=0 (the x axis)
 (previous
slide)
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
49
2D Geometric Transformations
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
Reflection
Reflection about the line x=0 (the y axis)
50
2D Geometric Transformations
 
R
eflection about the origin
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
51
 
2D Geometric Transformations
 
Reflection about the line 
y=x
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
52
 
2D Geometric Transformations
 
Reflection about the line 
y=-x
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
53
 
2D Geometric Transformations
 
Shear
Transformation that distorts the shape of an object
such that the transformed shape appears as the
object w
as
 composed of internal layers that had
been caused to slide over each other
y
x
(2,1)
(3,1)
(1,0)
(0,0)
sh
x
=2
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
54
2D Geometric Transformations
 
Shear
An x-direction shear relative to the x axis
 
 
 
 
An y-direction shear relative to the y axis
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
55
 
2D Geometric Transformations
 
Shear
x-direction shear relative to 
other reference lines
 
 
 
 
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
56
 
2D Geometric Transformations
 
E
x
a
m
p
l
e
 
A unit square (a) is transformed to a shifted parallelogram
(b) with 
sh
x
 = 0.5 and 
y
ref
 = −1 in the shear matrix 
from Slide 56
 
57
 
2D Geometric Transformations
 
Shear
y
-direction shear relative to 
the line 
x = x
ref
 
 
 
 
 
O
t
h
e
r
 
2
D
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
58
 
2D Geometric Transformations
 
E
x
a
m
p
l
e
 
A unit square (a) is turned into a shifted parallelogram
(b) with parameter values 
sh
y
 
= 0.5 and 
x
ref
 = −1 in the 
y
 -direction shearing
transformation 
from Slide 58
 
59
 
2D Geometric Transformations
 
This slide is intentionally left blank
Your responsibility to fill it 
R
a
s
t
e
r
 
M
e
t
h
o
d
s
 
f
o
r
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
a
n
d
 
O
p
e
n
G
L
60
2D Geometric Transformations
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
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.
61
2D Geometric Transformations
 
S
t
e
p
s
 
f
o
r
 
c
o
o
r
d
i
n
a
t
e
 
t
r
a
n
s
f
o
r
m
a
t
i
o
n
1.
Translate so that the origin (
x
0
, 
y
0
 ) of the
x
′-
y
′ system is moved to the origin of  the
x-y
 system.
2.
Rotate the 
x′ 
axis on to the axis 
x.
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
62
2D Geometric Transformations
 
 
y
 
x
 
x′
 
y'
 
θ
 
x
0
 
y
0
 
0
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
63
 
2D Geometric Transformations
 
 
y
 
x
 
x′
 
x
0
 
y
0
 
0
 
y′
 
θ
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
64
 
2D Geometric Transformations
 
 
y
 
x
 
x′
 
x
0
 
y
0
 
0
 
y′
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
65
 
2D Geometric Transformations
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
66
 
2D Geometric Transformations
 
   
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.
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
67
 
2D Geometric Transformations
 
Elements of any rotation matrix can be
expressed as elements of or
t
hogonal unit
vectors. That is, the rotation matrix
 can be
written as
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
68
 
2D Geometric Transformations
 
y
 
x
 
x′
 
y′
 
x
0
 
y
0
 
0
 
V
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
B
e
t
w
e
e
n
C
o
o
r
d
i
n
a
t
e
 
S
y
s
t
e
m
s
 
(
c
o
n
t
.
)
 
69
 
2D Geometric Transformations
O
p
e
n
G
L
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
F
u
n
c
t
i
o
n
s
 
A separate function is available for each of the
basic geometric transformations
AND
A
l
l
 
t
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
a
r
e
 
s
p
e
c
i
f
i
e
d
 
i
n
 
t
h
r
e
e
d
i
m
e
n
s
i
o
n
s
Why?
Answer: Remember; OpenGL was developed as
3D library
But how to perform 2D transformations?
Answer: Set 
z = 0
70
2D Geometric Transformations
B
a
s
i
c
 
O
p
e
n
G
L
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
Translation
glTranslate* (tx, ty, tz);
* 
is either 
f 
or
 d
tx, ty 
and
 tz 
are any real number
For 2D, set 
tz=0.0
Rotation
glRotate* (theta, vx, vy, vz);
* 
is either 
f 
or
 d
theta 
is rotation angle in degrees
 (internally converted to
radian)
Vector
 v=(vx, vy, vz) 
defines the orientation for a rotation axis
that passes through the coordinate origin
For 2D, set 
v
z=
1
.0
 
and
 vx=vy=0.0
71
2D Geometric Transformations
B
a
s
i
c
 
O
p
e
n
G
L
 
G
e
o
m
e
t
r
i
c
T
r
a
n
s
f
o
r
m
a
t
i
o
n
s
 
(
c
o
n
t
.
)
 
Scaling
glScale* (sx, sy, sz);
* 
is
 
either
 f 
or
 d
sx, sy 
and
 sz 
are any real number
N
e
g
a
t
i
v
e
 
v
a
l
u
e
s
 
g
e
n
e
r
a
t
e
 
r
e
f
l
e
c
t
i
o
n
Zero values can cause error because inverse matrix
cannot be calculated
 
A
ll routines construct a 
4
x
4 transformation
matrix
OpenGL uses composite matrices
Be careful with the order
72
2D Geometric Transformations
O
p
e
n
G
L
 
M
a
t
r
i
x
 
O
p
e
r
a
t
i
o
n
s
 
glMatrixMode(
.
);
Projection Mode: Determines how the scene is
projected onto the screen
Modelview Mode: Used for storing and combining
geometric transformations
Texture Mode: Used for mapping texture patterns
to surfaces
Color Mode: Used to convert from one color mode
to another
73
2D Geometric Transformations
O
p
e
n
G
L
 
M
a
t
r
i
x
 
O
p
e
r
a
t
i
o
n
s
 
Modelview matrix, used to store and combine
geometric transformations
glMatrixMode(GL_MODELVIEW);
A call to a transformation routine generates a
matrix that is multiplied by the current matrix
To assign the identity matrix to the current
matrix
glLoadIdentity();
 
74
2D Geometric Transformations
O
p
e
n
G
L
 
M
a
t
r
i
x
 
O
p
e
r
a
t
i
o
n
s
(
c
o
n
t
.
)
 
Alternatively:
gl
Load
Matrix
*
 (
elements16
);
To assign other values to the elements of the
current matrix
In column-major order:
First four elements in first column
Second four elements in second column
Third four elements in third column
Fourth four elements in fourth column
75
2D Geometric Transformations
O
p
e
n
G
L
 
M
a
t
r
i
x
 
O
p
e
r
a
t
i
o
n
s
(
c
o
n
t
.
)
 
Concatenating a specified matrix with current
matrix:
gl
Mult
Matrix
*
 (
otherElements16
);
Current matrix is postmultiplied (right-to-left) by
the specified matrix
 
Warning:
Matrix notation 
m
jk
 means:
In OpenGL: 
j
 
 column, 
k
  row
In mathematics: 
j
  row, 
k
  column
76
2D Geometric Transformations
O
p
e
n
G
L
 
M
a
t
r
i
x
 
S
t
a
c
k
s
 
OpenGL maintains a matrix stack for
transformations
Initially the modelview stack contains only the
identity matrix
More about it:
Coming soon
77
2D Geometric Transformations
OpenGL Transformation Routines
 
For example, assume we want to do in the following
order:
translate by +2, -3, +4,
rotate by 45
0
 around axis formed between origin and 1, 1, 1
scale with respect to the origin by 2 in each direction.
Our code would be
g
l
M
a
t
r
i
x
M
o
d
e
(
G
L
_
M
O
D
E
L
V
I
E
W
)
;
 
glLoadIdentity();
   
     //start with identity
 
glScalef(2.0,2.0,2.0);   //Note: 
Start with the LAST operation
 
glRotatef(45.0,1.0,1.0,1.0);
 
glTranslatef(2.0,-3.0, 4.0); //
End with the FIRST operation
78
2D Geometric Transformations
 
O
p
e
n
G
L
 
T
r
a
n
s
f
o
r
m
a
t
i
o
n
 
F
u
n
c
t
i
o
n
s
 
79
 
2D Geometric Transformations
 
 
Next Lecture
 
 
3D Geometric Transformations
 
 
 
 
 
 
80
 
References
 
Donald Hearn, M. Pauline Baker, Warren R.
Carithers, “Computer Graphics with OpenGL, 4th
Edition”; Pearson, 2011
Sumanta Guha, “Computer Graphics Through
OpenGL: From Theory to Experiments”, CRC Press,
2010
Edward Angel, “Interactive Computer Graphics. A
Top-Down Approach Using OpenGL”, Addison-
Wesley, 2005
 
81
Slide Note
Embed
Share

In this lecture on 2D Geometric Transformations, Assistant Professor Dr. Samsun M. BA ARICI covers topics such as translation, rotation, scaling, homogeneous representations, and coordinates. The lecture delves into basic transformations like reflection and shearing, as well as practical applications such as OpenGL transformations. Various modeling and rigid-body transformations are explored, offering insights into changing object positions, orientations, and sizes without deformation. The lecture also discusses methods for implementing transformations in 2D coordinate systems.


Uploaded on Jul 22, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. CSE 411 Computer Graphics Lecture #6 2D Geometric Transformations Prepared & Presented by Asst. Prof. Dr. Samsun M. BA ARICI

  2. Objectives HB Ch. 7, GVS Ch. 3 Basic 2D Transformations (rigid-body transformations): Translation Rotation Scaling Homogenenous Representations and Coordinates 2D Composite Transformations 2D Geometric Transformations 2

  3. Objectives (cont.) Other Transformations: Reflection Shearing Raster Methods for Transformations and OpenGL Transformations between 2D Coordinate Systems and OpenGL 2D Geometric Transformations 3

  4. Geometric Transformations Sometimes also called modeling transformations Geometric transformations: Changing an object s position (translation), orientation (rotation) or size (scaling) Modeling transformations: Constructing a scene or hierarchical description of a complex object Others transformations: reflection and shearing operations 2D Geometric Transformations 4

  5. Basic 2D Geometric Transformations 2D Translation P T P x = x + tx, y = y + ty = y t ' x x x = = , ' , P P T ' t y y P =P+T Translation moves the object without deformation (rigid-body transformation) 2D Geometric Transformations 5

  6. Basic 2D Geometric Transformations (cont.) 2D Translation To move a line segment, apply the transformation equation to each of the two line endpoints and redraw the line between new endpoints To move a polygon, apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates 2D Geometric Transformations 6

  7. 2D Translation Routine class wcPt2D { public: GLfloat x, y; }; void translatePolygon (wcPt2D * verts, GLint nVerts, GLfloat tx, GLfloat ty) { GLint k; for (k = 0; k < nVerts; k++) { verts [k].x = verts [k].x + tx; verts [k].y = verts [k].y + ty; } glBegin (GL_POLYGON); for (k = 0; k < nVerts; k++) glVertex2f (verts [k].x, verts [k].y); glEnd ( ); } 2D Geometric Transformations 7

  8. Basic 2D Geometric Transformations (cont.) 2D Rotation Rotation axis Rotation angle rotation point or pivot point (xr,yr) yr xr 2D Geometric Transformations 8

  9. Basic 2D Geometric Transformations (cont.) 2D Rotation If is positive counterclockwise rotation If is negative clockwise rotation Remember: cos(a + b) = cos a cos b - sin a sin b cos(a - b) = cos a sin b + sin a cos b 2D Geometric Transformations 9

  10. Basic 2D Geometric Transformations (cont.) 2D Rotation At first, suppose the pivot point is at the origin x =r cos( + ) = r cos cos - r sin sin y =r sin( + ) = r cos sin + r sin cos x = r cos , y = r sin x =x cos - y sin y =x sin + y cos (x ,y ) r (x,y) r 2D Geometric Transformations 10

  11. Basic 2D Geometric Transformations 2D Rotation P =R P cos cos sin = R sin (x ,y ) r (x,y) r 2D Geometric Transformations 11

  12. Basic 2D Geometric Transformations (cont.) 2D Rotation Rotation of a point about any specified position (xr,yr) x =xr+(x - xr) cos (y - yr) sin y =yr+(x - xr) sin + (y - yr) cos Rotations also move objects without deformation A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates 2D Geometric Transformations 12

  13. 2D Rotation Routine class wcPt2D { public: GLfloat x, y; }; void rotatePolygon (wcPt2D * verts, GLint nVerts, wcPt2D pivPt, GLdouble theta) { wcPt2D * vertsRot; GLint k; for (k = 0; k < nVerts; k++) { vertsRot [k].x = pivPt.x + (verts [k].x - pivPt.x) * cos (theta) - (verts [k].y - pivPt.y) * sin (theta); vertsRot [k].y = pivPt.y + (verts [k].x - pivPt.x) * sin (theta) + (verts [k].y - pivPt.y) * cos (theta); } glBegin (GL_POLYGON); for (k = 0; k < nVerts; k++) glVertex2f (vertsRot [k].x, vertsRot [k].y); glEnd ( ); } 2D Geometric Transformations 13

  14. Basic 2D Geometric Transformations (cont.) 2D Scaling Scaling is used to alter the size of an object Simple 2D scaling is performed by multiplying object positions (x, y) by scaling factors sxand sy x = x sx y = y sx y s y y 0 ' 0 s ' x x x = or P = S P 2D Geometric Transformations 14

  15. Basic 2D Geometric Transformations (cont.) 2D Scaling Any positive value can be used as scaling factor Values less than 1 reduce the size of the object Values greater than 1 enlarge the object If scaling factor is 1 then the object stays unchanged If sx= sy, we call it uniform scaling If scaling factor <1, then the object moves closer to the origin and If scaling factor >1, then the object moves farther from the origin x x 2D Geometric Transformations 15

  16. Basic 2D Geometric Transformations (cont.) 2D Scaling Why does scaling also reposition object? Answer: See the matrix (multiplication) Still no clue? ? ?= ?? 0 0 ?? ? ??+ ? 0 ? 0 + ? ?? ? ? = 2D Geometric Transformations 16

  17. Basic 2D Geometric Transformations (cont.) 2D Scaling We can control the location of the scaled object by choosing a position called the fixed point (xf,yf) x xf= (x xf) sx y yf= (y yf) sy x =x sx+ xf(1 sx) y =y sy+ yf(1 sy) Polygons are scaled by applying the above formula to each vertex, then regenerating the polygon using the transformed vertices 2D Geometric Transformations 17

  18. 2D Scaling Routine class wcPt2D { public: GLfloat x, y; }; void scalePolygon (wcPt2D * verts, GLint nVerts, wcPt2D fixedPt, GLfloat sx, GLfloat sy) { wcPt2D vertsNew; GLint k; for (k = 0; k < n; k++) { vertsNew [k].x = verts [k].x * sx + fixedPt.x * (1 - sx); vertsNew [k].y = verts [k].y * sy + fixedPt.y * (1 - sy); } glBegin (GL_POLYGON); for (k = 0; k < n; k++) glVertex2v (vertsNew [k].x, vertsNew [k].y); glEnd ( ); } 2D Geometric Transformations 18

  19. Matrix Representations and Homogeneous Coordinates Many graphics applications involve sequences of geometric transformations Animations Design and picture construction applications We will now consider matrix representations of these operations Sequences of transformations can be efficiently processed using matrices 2D Geometric Transformations 19

  20. Matrix Representations and Homogeneous Coordinates (cont.) P = M1 P + M2 P and P are column vectors M1is a 2 by 2 array containing multiplicative factors M2is a 2 element column matrix containing translational terms For translation M1is the identity matrix For rotation or scaling, M2contains the translational terms associated with the pivot point or scaling fixed point 2D Geometric Transformations 20

  21. Matrix Representations and Homogeneous Coordinates (cont.) To produce a sequence of operations, such as scaling followed by rotation then translation, we could calculate the transformed coordinates one step at a time A more efficient approach is to combine transformations, without calculating intermediate coordinate values 2D Geometric Transformations 21

  22. Matrix Representations and Homogeneous Coordinates (cont.) Multiplicative and translational terms for a 2D geometric transformation can be combined into a single matrix if we expand the representations to 3 by 3 matrices We can use the third column for translation terms, and all transformation equations can be expressed as matrix multiplications 2D Geometric Transformations 22

  23. Matrix Representations and Homogeneous Coordinates (cont.) Expand each 2D coordinate (x,y) to three element representation (xh,yh,h) called homogeneous coordinates h is the homogeneous parameter such that x = xh/h, y = yh/h, infinite homogeneous representations for a point A convenient choice is to choose h = 1 2D Geometric Transformations 23

  24. Matrix Representations and Homogeneous Coordinates (cont.) 2D Translation Matrix = 0 1 ' 1 0 x t x x ' 0 1 y t y y 0 1 1 or, P = T(tx,ty) P 2D Geometric Transformations 24

  25. Matrix Representations and Homogeneous Coordinates (cont.) 2D Rotation Matrix cos ' cos sin 0 x x ' = sin 0 y y 1 0 0 1 1 or, P = R( ) P 2D Geometric Transformations 25

  26. Matrix Representations and Homogeneous Coordinates (cont.) 2D Scaling Matrix ' 0 s 0 x s x x ' = 0 0 y y y 1 0 0 1 1 or, P = S(sx,sy) P 2D Geometric Transformations 26

  27. Inverse Transformations 2D Inverse Translation Matrix = 0 1 0 t x 1 0 1 T t y 0 1 By the way: * = 1 T T I 2D Geometric Transformations 27

  28. Inverse Transformations (cont.) 2D Inverse Rotation Matrix cos sin 0 = 1 sin cos 0 R 0 0 1 And also: * = 1 R R I 2D Geometric Transformations 28

  29. Inverse Transformations (cont.) 2D Inverse Rotation Matrix: If is negative clockwise In R R = * 1 I Only sine function is affected Therefore we can say R R = 1 T Is that true? Proof: It s up to you 2D Geometric Transformations 29

  30. Inverse Transformations (cont.) 2D Inverse Scaling Matrix 1 s 0 0 x 1 s = 1 0 0 S y 0 0 1 Of course: * = 1 S S I 2D Geometric Transformations 30

  31. 2D Composite Transformations We can setup a sequence of transformations as a composite transformation matrix by calculating the product of the individual transformations P =M2 M1 P =M P 2D Geometric Transformations 31

  32. 2D Composite Transformations (cont.) Composite 2D Translations If two successive translation are applied to a point P, then the final transformed location P' is calculated as = = + + P T T P T P ' ( , ) ( , ) ( , ) t t t t t t t t x y x y x x y y 2 2 1 1 1 2 1 2 + 1 0 1 0 1 0 t t t t 2 1 1 2 x x x x = + 1 0 1 0 1 0 1 t t t t 2 1 1 2 y y y y 0 0 1 0 0 1 0 0 2D Geometric Transformations 32

  33. 2D Composite Transformations (cont.) Composite 2D Rotations = + P R P ' ( ) 1 2 cos cos + cos( + cos sin 0 cos sin 0 cos( ) sin( ) 0 2 2 1 1 1 2 1 2 0 0 = + + sin 0 sin 0 sin( ) ) 0 2 2 1 1 1 2 1 2 0 1 0 1 0 0 1 2D Geometric Transformations 33

  34. 2D Composite Transformations (cont.) Composite 2D Scaling = S S S ( , ) ( , ) ( , ) s s s s s s s s x y x y x x y y 2 2 1 1 1 2 1 2 0 0 0 0 0 0 0 s s s s 2 1 1 2 x x x x = 0 0 0 0 0 0 s s s s 2 1 1 2 y y y y 0 0 1 0 0 1 0 1 2D Geometric Transformations 34

  35. 2D Composite Transformations (cont.) Don t forget: Successive translations are additive Successive scalings are multiplicative For example: If we triple the size of an object twice, the final size is nine (9) times the original 9 times? Why? Proof: Again up to you 2D Geometric Transformations 35

  36. 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. 1. 2. 3. 2D Geometric Transformations 36

  37. General Pivot Point Rotation 2D Geometric Transformations 37

  38. 2D Composite Transformations (cont.) General 2D Pivot-Point Rotation 0 1 0 0 cos 1 0 cos sin 0 1 0 x x r r 0 1 sin 0 0 1 y y r r 0 1 0 0 1 cos + cos sin 1 ( r y cos ) sin x y r = 1 sin 1 ( r cos ) sin x r 0 0 2D Geometric Transformations 38

  39. 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. 1. 2. 3. 2D Geometric Transformations 39

  40. General Fixed Point Scaling (cont.) (xr, yr) (xr, yr) 2D Geometric Transformations 40

  41. General Fixed Point Scaling (cont.) General 2D Fixed-Point Scaling: 1 0 ?? 0 1 ?? 0 0 1 1 0 ?? 0 1 ?? 0 0 1 ??0 ??(1 ??) 0 ????(1 ??) 0 0 ??0 0 0 ??0 0 0 1 . . = 1 ?(??,??) ?(??,??) ?( ??, ??) = ?(??,??,??,??) 2D Geometric Transformations 41

  42. 2D Composite Transformations (cont.) General 2D scaling directions: Above: scaling parameters were along x and y directions What about arbitrary directions? Answer: See next slides 2D Geometric Transformations 42

  43. General 2D Scaling Directions Scaling parameters s1and s2along orthogonal directions defined by the angular displacement . 2D Geometric Transformations 43

  44. General 2D Scaling Directions (cont.) General procedure: Rotate so that directions coincides with x and y axes Apply scaling transformation ? ?1,?2 Rotate back The composite matrix: ?1cos2 + ?2sin2 ?2 ?1cos sin 0 1. 2. 3. ?2 ?1cos sin 0 ?1sin2 + ?2cos2 0 0 ? 1 ? ?1,?2 ? = 1 2D Geometric Transformations 44

  45. 2D Composite Transformations (cont.) Matrix Concatenation Properties: Matrix multiplication is associative ! M3 M2 M1= (M3 M2 ) M1 = M3 ( M2 M1 ) A composite matrix can be created by multiplicating left- to-right (premultiplication) or right-to-left (postmultiplication) Matrix multiplication is not commutative ! M2 M1 M1 M2 2D Geometric Transformations 45

  46. 2D Composite Transformations (cont.) Matrix Concatenation Properties: But: Two successive rotations Two successive translations Two successive scalings are commutative! Why? Proof: You got it: Up to you 2D Geometric Transformations 46

  47. Reversing the order in which a sequence of transformations is performed may affect the transformed position of an object. In (a), an object is first translated in the x direction, then rotated counterclockwise through an angle of 45 . In (b), the object is first rotated 45 counterclockwise, then translated in the x direction 2D Geometric Transformations 47

  48. Other 2D Transformations Reflection Transformation that produces a mirror image of an object 2D Geometric Transformations 48

  49. Other 2D Transformations (cont.) Reflection Image is generated relative to an axis of reflection by rotating the object 180 about the reflection axis Reflection about the line y=0 (the x axis) (previous slide) 1 0 0 1 0 0 0 1 0 2D Geometric Transformations 49

  50. Other 2D Transformations (cont.) Reflection Reflection about the line x=0 (the y axis) 1 0 0 0 1 0 0 0 1 2D Geometric Transformations 50

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#