Download - 1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball
3
Modeling Transform• Specify transformation for objects
– Allow definitions of objects in own coordinate systems
– Allow use of object definition multiple times in a scene
4
Overview• 2D transformations
– Basic 2-D transformations– Matrix representation– Matrix composition
• 3D transformations– Basic 3-D transformation– Same as 2-D
• Transformation Hierarchies– Scene graphs
12
Basic 2D Transformations
xtxx '
ytyy '
xSxx '
ySyy '
yShxx x 'xShyy y '
sincos' yxx cossin' yyy
y
x
Syy
Sxx
'
'
13
Basic 2D Transformations
xtxx 'ytyy '
xSxx '
ySyy '
sincos' yxx cossin' yyy
yShxx x 'xShyy y '
cos)(sin)('
sin)(cos)('
yx
yx
SySxy
SySxx
19
Basic 2D Transformations
xtxx 'ytyy '
xSxx '
ySyy '
yShxx x 'xShyy y '
sincos' yxx cossin' yyy
cos)(sin)('
sin)(cos)('
yx
yx
SySxy
SySxx
20
Basic 2D Transformations
xtxx '
ytyy '
xSxx '
ySyy '
yShxx x 'xShyy y '
sincos' yxx cossin' yyy
yyx
xyx
tSySxy
tSySxx
cos)(sin)('
sin)(cos)('
21
Basic 2D Transformations
xtxx '
ytyy '
xSxx '
ySyy '
yShxx x 'xShyy y '
sincos' yxx cossin' yyy
yyx
xyx
tSySxy
tSySxx
cos)(sin)('
sin)(cos)('
45
GENERAL ROTATION ABOUT ANAXIS
An axis in space is specified by a point P and a vector direction .Suppose that we wish to rotate an object about this arbitrary axis.
t
51
Developing the General Rotation Matrix
• Be careful …………
Z
X
(+,+)
(-,-)In both cases, tan(y/x) are positive.So, we need to carefully chooseit by checking the signs of x and y
52
Developing the General Rotation Matrix
Another problem is: rotation interpolation is not easy and not goodreported in many papers.
55
Angular displacement glRotate( , Ax,Ay,Az)
• (,n) defines an angular displacement of about an axis u or n for rotating a vector v
56
sin)()cos1)((cos
sin)(cos))(()(
sin)(cos][][][][ ||||||
vnvnnv
vnnvnvnvn
vnvvvRvRvvRvR
The above formula is a matrix form, so we can use Matrix to compute rotation
In above equation, v=(x,y,z)T and n=(ax,ay,az)T