modeling transformation
DESCRIPTION
Modeling Transformation. Overview. 2D Transformation Basic 2D transformations Matrix representation Matrix Composition 3D Transformation Basic 3D transformations Same as 2D Transformation Hierarchies Scene graphs Ray casting. Modeling Transformation. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/1.jpg)
Modeling Transformation
![Page 2: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/2.jpg)
Overview
2D Transformation Basic 2D transformations Matrix representation Matrix Composition
3D Transformation Basic 3D transformations Same as 2D
Transformation Hierarchies Scene graphs Ray casting
![Page 3: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/3.jpg)
Modeling Transformation
Specify transformations for objects Allow definitions of objects in own coordinate systems Allow use of object definition multiple times in a scene
Ref] Hearn & Baker
![Page 4: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/4.jpg)
2D Modeling Transformations
![Page 5: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/5.jpg)
2D Modeling Transformations
![Page 6: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/6.jpg)
Basic 2D Transformations
Translation x’ = x + tx y’ = y + ty
Scale x’ = x * sx y’ = y * sy
Shear x’ = x + hx * y y’ = y + hy * x
Rotation x’ = x * cos - y * sin y’ = x * sin + y * cos
![Page 7: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/7.jpg)
Matrix Representation
Represent 2D transformation by a matrix
Multiply matrix by column vector Apply transformation to point
dc
ba
y
x
dc
ba
y
x
'
'
dycxy
byaxx
'
'
![Page 8: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/8.jpg)
Matrix Representation
Transformations combined by multiplication
Matrices are a convenient and efficient way to represent a sequence of transformations
y
x
lk
ji
hg
fe
dc
ba
y
x
'
'
![Page 9: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/9.jpg)
2 x 2 Matrices
What types of transformations can be represented with a 2 x 2 matrix? 2D Identity
2D Scale around (0, 0)
y
x
y
x
10
01
'
'
yy
xx
'
'
y
x
sy
sx
y
x
0
0
'
'
ysyy
xsxx
'
'
![Page 10: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/10.jpg)
2 x 2 Matrices
What types of transformations can be represented with a 2x 2 matrix? 2D Rotate around (0, 0)
2D Shear
y
x
y
x
cossin
sincos
'
'
yxy
yxx
cossin'
sincos'
y
x
shy
shx
y
x
1
1
'
'
yxshyy
yshxxx
'
'
shx = 2
![Page 11: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/11.jpg)
2 x 2 Matrices
What types of transformations can be represented with a 2x 2 matrix? 2D Mirror (=Reflection) over Y axis
2D Mirror over (0, 0)
y
x
y
x
10
01
'
'
yy
xx
'
'
y
x
y
x
10
01
'
'
yy
xx
'
'
![Page 12: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/12.jpg)
2 x 2 Matrices
What types of transformations can be represented with a 2x 2 matrix? 2D Translation ?
tyyy
txxx
'
'NO!
Only linear 2D transformation can be presented with a 2 x 2 matrix
![Page 13: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/13.jpg)
Linear Transformations
Linear transformations are combinations of … Scale Rotation Shear Mirror (=Reflection)
Properties of linear transformations Satisfies: Origin maps to origin Lines map to lines Parallel line remain parallel Ratios are preserved Closed under composition
y
x
dc
ba
y
x
'
'
)()()( 221221 pppp 11 TsTsssT
![Page 14: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/14.jpg)
2D Translation
2D Translation represented by a 3 x 3 matrix Point represented with homogeneous coordinate
tyyy
txxx
'
'
1100
10
01
1
'
'
y
x
ty
tx
y
x
![Page 15: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/15.jpg)
Homogeneous Coordinates
Add a 3rd coordinate to every 2D point (x, y, w) represents a point at location (x/w, y/w) (x, y, 0) represents a point at infinity (0, 0, 0) is not allowed
![Page 16: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/16.jpg)
Basic 2D Transformations
Basic 2D Transformations as 3 x 3 matrices
![Page 17: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/17.jpg)
Affine Transformations
Affine Transformations are combinations of … Linear transformation Translation
Properties of affine transformations Origin does not necessarily map to origin Lines map to lines Parallel line remain parallel Ratios are preserved Closed under composition
w
y
x
fed
cba
w
y
x
100
'
'
![Page 18: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/18.jpg)
Transformation : Rigid-Body / Euclidean Transforms
Rigid Body Transformation (=rigid motion) A transform made up of only translation and rotation Preserve the shape of the objects that they act on
• Preserves distances
• Preserves angles
TranslationRotation
Rigid / Euclidean
Identity
![Page 19: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/19.jpg)
Transformation : Similitudes / Similarity Transforms
Similarity Transformations Preserves angles Translation, Rotation,
Isotropic scaling
TranslationRotation
Rigid / Euclidean
Similitudes
Isotropic ScalingIdentity
![Page 20: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/20.jpg)
Transformation : Linear Transformations
TranslationRotation
Rigid / EuclideanLinear
Similitudes
Isotropic ScalingIdentity
Scaling
Shear
Reflection
Translation is not linear
![Page 21: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/21.jpg)
Transformation : Affine Transformations
preserves parallel lines
TranslationRotation
Rigid / EuclideanLinear
Similitudes
Isotropic Scaling
Scaling
Shear
ReflectionIdentity
Affine
![Page 22: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/22.jpg)
Transformation : Projective Transformations
preserves lines
TranslationRotation
Rigid / EuclideanLinear
Affine
Projective
Similitudes
Isotropic Scaling
Scaling
Shear
Reflection
Perspective
Identity
![Page 23: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/23.jpg)
Projective Transformations
Projective Transformations … Affine transformation Projective warps
Properties of projective transformations Origin does not necessarily map to origin Lines map to lines Parallel line do not necessarily remain parallel Ratios are not preserved (but “cross-ratios” are) Closed under composition
w
y
x
ihg
fed
cba
w
y
x
'
'
![Page 24: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/24.jpg)
Cross-ratio
Given any four points A, B, C, and D, taken in order, define their cross ratio as
Cross Ratio (ABCD) =
DBDACBCA
cross ratio (ABCD) = cross ratio (A'B'C'D')
![Page 25: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/25.jpg)
Matrix Composition
Transformations can be combined by matrix multiplication
![Page 26: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/26.jpg)
Matrix Composition
Matrices are a convenient and efficient way to represent a sequence of transformations General purpose representations Hardware matrix multiply Efficiency with premultiplication
p
p
)('
)))((('
SRTp
SRTp
![Page 27: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/27.jpg)
Matrix Composition
Be aware: order of transformations matter Matrix multiplication is not commutative
p SRTp'“Global” “Local”
![Page 28: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/28.jpg)
Non-commutative Composition
Scale then Translate: p' = T ( S p ) = TS p
Translate then Scale: p' = S ( T p ) = ST p
(0,0)
(1,1)(4,2)
(3,1)
(8,4)
(6,2)
(0,0)
(1,1)(2,2)
(0,0)
(5,3)
(3,1)Scale(2,2) Translate(3,1)
Translate(3,1) Scale(2,2)
![Page 29: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/29.jpg)
Matrix Composition
Rotate by around arbitrary point (a, b) M = T(a, b)* R() * T(-a, -b)
1. Translate (a, b) to the origin
2. do the rotation about origin
3. translate back
Scale by sx, sy around arbitrary point (a, b) M = T(a, b)* S(sx, sy) * T(-a, -b)
1. Translate (a, b) to the origin
2. do the scale about origin
3. translate back
![Page 30: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/30.jpg)
Transformation Game
![Page 31: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/31.jpg)
Overview
2D Transformation Basic 2D transformations Matrix representation Matrix Composition
3D Transformation Basic 3D transformations Same as 2D
Transformation Hierarchies Scene graphs Ray casting
![Page 32: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/32.jpg)
3D Transformations
Same idea as 2D transformations Homogeneous coordinates: (x, y, z, w) 4 x 4 transformation matrices
w
z
y
x
ponm
lkji
hgfe
dcba
w
z
y
x
'
'
'
![Page 33: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/33.jpg)
Basic 3D transformations
![Page 34: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/34.jpg)
Basic 3D transformations
![Page 35: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/35.jpg)
Non-commutative Composition : Order of Rotations
Order of Rotation Affects Final Position X-axis Z-axis
Z-axis X-axis
![Page 36: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/36.jpg)
Matrix Composition : Rotations in space
Rotation about an Arbitrary Axis Rotate about some arbitrary a through angle
1. Rotate about the z axis through an angle – The axis a lies in the yz plane
2. Rotate about the x axis through an angle – The axis a coincident with the z axis
3. Rotate about the a axis through – Same as a rotation about the now coincident z axis
4. Reverse the second rotation about the x axis
5. Reverse the first rotation about the z axis– Returning the axis a to its original position
PRP '
PRRP '
PRRRP 'PRRRRP
1'
PRRRRRP 11 ' y
z
x
a
![Page 37: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/37.jpg)
Transformation Hierarchies
Scene may have hierarchy of coordinate systems Each level stores matrix representing transformation from
parent’s coordinate system
![Page 38: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/38.jpg)
Transformation Example 1
Well-suited for humanoid characters
![Page 39: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/39.jpg)
Transformation Example 1
Ref] Princeton University
![Page 40: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/40.jpg)
Transformation Example 2
An object may appear in a scene multiple times
![Page 41: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/41.jpg)
Transformation Example 2
![Page 42: Modeling Transformation](https://reader035.vdocuments.site/reader035/viewer/2022070410/5681458d550346895db27883/html5/thumbnails/42.jpg)
Summary
Coordinate systems World coordinates Modeling coordinates
Representations of 3D modeling transformations 4 x 4 Matrices
• Scale, rotate, translate, shear, projections, etc.
• Not arbitrary warps
Composition of 3D transformations Matrix multiplication (order matters) Transformation hierarchies