ii-1 transformations transformations are needed to: position objects defined relative to the origin...
DESCRIPTION
II-3 Rotation Consider rotation about the origin by degrees –radius stays the same, angle increases by x’=x cos –y sin y’ = x sin + y cos x = r cos y = r sin x’ = r cos ( y’ = r sin ( TRANSCRIPT
![Page 1: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/1.jpg)
II-1
Transformations• Transformations are needed to:
– Position objects defined relative to the origin– Build scenes based on hierarchies– Project objects from three to two dimensions
• Transformations include:– Translation– Scaling– Rotation– Reflections
• Transformations can be represented by matrices and matrix multiplication
II 2D Transformation
![Page 2: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/2.jpg)
II-2
• Transformation of Points
yx
yx
• Representation of Points: ;
**)()( yxdybxcyaxdcba
yxTX
• Transformation of Straight Lines
![Page 3: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/3.jpg)
II-3
Rotation• Consider rotation about the origin by
degrees– radius stays the same, angle increases by
x’=x cos –y sin y’ = x sin + y cos
x = r cos y = r sin
x’ = r cos (y’ = r sin (
![Page 4: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/4.jpg)
II-4
• The transformation for a general rotation about the origin by an arbitrary angle
cossinsincos
T
cossinsincos
*** yxyxTXX
cossinsincos
T
yx
yx
XTX
cossinsincos
***
![Page 5: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/5.jpg)
II-5
Scaling• Scaling increases or decreases the size of the
object• Scaling occurs with respect to the origin
– If the object is not centered at the origin, it will move in addition to changing size
• In general, this is done with the equations:xn = sx * xyn = sy * y
• This can also be done with the matrix multiplication:
yx
ss
yx
y
x
n
n
00
![Page 6: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/6.jpg)
II-6
2002
T
2/1003
T• Example:
![Page 7: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/7.jpg)
II-7
Reflection• corresponds to negative scale factors
originalsx = -1 sy = 1
sx = -1 sy = -1 sx = 1 sy = -1
![Page 8: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/8.jpg)
II-8
10
01T
1001
T
0110
T
0110
T
• The reflection about the y=x is obtained by
• The reflection about the y-axis (x=0) is obtained by
• The reflection about the x-axis (y=0) is obtained by
• The reflection about the y=-x is obtained by
![Page 9: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/9.jpg)
II-9
![Page 10: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/10.jpg)
II-10
![Page 11: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/11.jpg)
II-11
Translations• The amount of the translation is added to or
subtracted from the x and y coordinates• In general, this is done with the equations:
xn = x + tx
yn = y + ty
• This can also be done with the matrix multiplication:
11001001
1yx
tt
yx
y
x
n
n
1010001
11
yx
nn
ttyxyx
![Page 12: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/12.jpg)
II-12
Homogeneous Coordinates• The two dimensional point (x, y) is represented by
the homogeneous coordinate (x, y, 1)• Some transformations will alter this third
component so it is no longer 1• In general, the homogeneous coordinate (x, y, w)
represents the two dimensional point (x/w, y/w)• General transformation matrix:
100
nmdcba
T
100ndcmba
T
![Page 13: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/13.jpg)
II-13
Order of Transformations• Matrix multiplication is not commutative so
changing the order of transformation can change the result
• For example, changing the order of a translation and a rotation produces a different result:
![Page 14: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/14.jpg)
II-14
![Page 15: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/15.jpg)
II-15
![Page 16: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/16.jpg)
II-16
![Page 17: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/17.jpg)
II-17
• Rotation about an arbitrary point through an angle
nm
1010001
1000cossin0sincos
1010001
11**
nmnmyxyx
![Page 18: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/18.jpg)
II-18
![Page 19: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/19.jpg)
II-19
![Page 20: II-1 Transformations Transformations are needed to: Position objects defined relative to the origin Build scenes based on hierarchies Project objects](https://reader036.vdocuments.mx/reader036/viewer/2022062401/5a4d1b687f8b9ab0599b1e7a/html5/thumbnails/20.jpg)
II-20