CS580
Transformations
Ulrich Neumann
CS580
Computer Graphics Rendering 
Transformation Example (1)
What are the 2D coordinates of the vertices? 
V1
V3
V2 
Transformation Example (2)
A reference frame (origin and axes) is required to measure or specify numeric coordinates. 
V1
V3
V2
Y
X
(0,0) 
Transformation Example (3)
Case 1:Changing (transforming) the object coordinates changes the objects location in the coordinate frame. 
Y
X
(0,0)
V1
V3
V2 
Transformation Example (4)
Case 2:Changing (transforming) the reference frame also changes the object coordinates. 
V1
V3
V2 
Y
X
(0,0) 
Transformations
Linear transformations (Xforms) define a mapping of coordinates (coords) in one coordinate frame to another
the mappings are 1:1 and invertible
Vb = Xba Va
homogeneous vectors (V) are 41 columns (x,y,z,w)T
homogeneous transforms (X) are 44 matricies
Projection of 4D points into a subspace (w = 1) yields Euclidean 3-space values(examples shown later)
General Xforms can be decomposed into scale, translate, rotate, shear, reflection, 
View Xforms in graphics are a subset based on S T R
Scale, Translate, Rotate
we do not allow shears or other
non-shape-preserving transforms 
Basic Types
Scalars:s 
3D Points:
3D Direction vectors:
3D Translations
Translations occur along the axes of the space
Axis directions are preserved, but origin changes 
Translation is vector addition
Properties of Translations
=
=
=
= 
Rotations (2D)
x
y
rotation of point about origin
by angle theta 
3D Rotations about Axes
Rotations occur about the origin of the space
The origin does not change (fixed-point), but the axis directions do
The input axes prior to rotation (e.g., (1,0,0)  ) may become non-axis vectors 
3D General Rotation
This matrix rotates the point (x,y,z) about the vector u,v,w by the angle , under the constraint that u,v,w is a unit vector; i.e., that u2 + v2 + w2 = 1 
http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/
3D Scaling
Uniform scaling iff
Scaling occurs about the origin of the space
The origin does not change (fixed-point)
The axis directions do not change (preserves axes)
Distances between points change 
4D Homogeneous Coordinates
can be represented as
where
A 3D coord (x,y,z) is represented by an infinite locus of 4D coords of varying w
The projection of 4D coords to manifold w=1 is the 3D coord system
Projection of 4D coord is done by scaling about the origin (0,0,0,0) with a divide by w 
(x,y,z) <==> (x,y,z,1) <==> (X/w, Y/w, Z/w, w/w) <==> (X, Y, Z, w)
4D to 3D Conversions
Convert 3D to 4D by adding a w=1 term
Convert 4D to 3D by dividing all terms by w 
4D Translation
using homogeneous transformation 
4D Rotation & Scaling
homogeneous transformation
We will always assume Sx = Sy = Sz (uniform scaling),
unless clearly noted otherwise
The term along the axes of rotation is unchanged (x in this case) 
Combining Transformations
where
The result of a sequence of transformations [T] [R] [S] v
is the same as the result of a single transformation [M] v
where M is the concatenated (or combined) transformM = [T] [R] [S]
and concatenation is right-to-left 
Scale and Rotation Combined
Xad = Xab Xbc Xcd
chain any S,R,T matricesto arbitrary length
fully associative (combine any adjacent xforms)
X = S R = R S(commutative property is for S,R only)
rotation and scaling commute  neither change origin
assume uniform scaling in all dimensions
translations do not commute with R or S
due to change of origin (fixed-point) 
Start with v
apply SR or RS
to arrive at the
same result 
Origin
R
S
RSv = SRv
v 
Translation
Translations do not commute with R or S 
TR RT TS ST
Origin
STv
TSv 
RTv
TRv
Origin 
v
v 
Rotation and Translation Combined
A 44 matrix combining rotation and translationXab = T R
Rotation about origin in space-b occurs first
Then, translation using axis of space-a is applied 
Xab = =
T R
A different transformation (and matrix) is obtained if we reorder the operations as: Xab  R T
The translation occurs first, shifting the origin along the axes in space-b
The rotation follows about the new origin and axes of space-b 
(Note that R can also contain a scale xform S, and RS=SR so they commute)
cos  0sin  xt
0 1 0yt
-sin  0 cos  zt
0 0 01 
1 0 0xt
0 1 0yt
0 0 1zt
0 0 01 
cos 0sin  0
01 00
-sin 0cos 0
000 1 
Rotations in 2D and 3D
Successive rotations in 2D commuteR1 R2 = R2 R1 
2D rotations are about the same axis (perpendicular to the 2D plane)
Successive rotations in 3D do not commute
R1 R2  R2 R1
The object-axes are altered by each rotation 
Show this with 90-degree 3D rotations of a dice
Spin it CCW, then flip it 
vs
Flip it, then spin it CCW 
The outcome is different
z
y
x 
z
y
x 
z
y
x 
z
y
x 
+
=
z
y
x
t
t
t
z
y
x
v
t
t
t
T
z
y
x
z
y
x
)
,
,
( 
v
v
v
)
0
,
0
,
0
(
T 
v),,(),,( zyxzyx tttTsssT
v),,(),,( zyxzyxtttTsssT
v),,(1 zyx tttT
v),,(
1
zyxtttT 
v),,(),,( zyxzyx tttTsssT
v),,(),,( zyxzyxtttTsssT
v),,(),,( zyxzyx sssTtttT
v),,(),,( zyxzyxsssTtttT
v),,( zzyyxx tststsT +++
v),,( zzyyxxtststsT +++
v),,( zyx tttT
v),,(zyxtttT
sin
cos
ry
rx 
=
=
f
f
sin
cos
ry
rx
=
= 
cos)sin(sin)cos(
sin)sin(cos)cos( 
rry
rrx 
+=
=
qfqf
qfqf
cos)sin(sin)cos(
sin)sin(cos)cos(
rry
rrx
+=
-= 
)sin(
)cos( 
+=
+=
ry
rx 
)sin(
)cos(
qf
qf
+=
+=
ry
rx 
cossinsincos)sin(
sinsincoscos)cos( 
=+
=+
qfqfqf
qfqfqf
cossinsincos)sin(
sinsincoscos)cos(
-=+
-=+ 
f
q
cossin
sincos
yxy
yxx 
+=
=
qq
qq
cossin
sincos
yxy
yxx
+=
-= 
yx,
yx,
, yx
,yx
x
x
y
y
1
0
0
0
cos
sin
0
sin
cos
)
(
cos
0
sin
0
1
0
sin
0
cos
)
(
cos
sin
0
sin
cos
0
0
0
1
)
(
q
q
q
q
q
q
q
q
q
q
q
q
q
q
q
z
y
x
R
R
R 
=
=
z
y
x
s
s
s
z
s
y
s
x
s
z
y
x
z
y
x
z
y
x
0
0
0
0
0
0
z
y
x
z
y
x
s
s
s
s
s
s
S
0
0
0
0
0
0
)
,
,
( 
zyx sss ==
zyxsss==
z
y
x 
z
y
x 
w
Z
Y
X 
w
Z
Y
X 
w
Z 
z
w
Y 
y
w
X 
x === ,,
w
Z
z
w
Y
y
w
X
x ===,, 
=
=
w
Z
Y
X
z
y
x
z
y
x
1 
=
+
+
+
=
=
1
1
0
0
0
1
0
0
0
1
0
0
0
1
1
1
)
,
,
(
z
y
x
t
t
t
t
z
t
y
t
x
z
y
x
z
y
x
v
t
t
t
T
z
y
x
z
y
x
z
y
x 
=
=
=
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
)
,
,
(
z
y
x
s
s
s
z
s
y
s
x
s
z
y
x
z
y
x
v
s
s
s
S
z
y
x
z
y
x
z
y
x 
=
=
1
1
0
0
0
0
cos
sin
0
0
sin
cos
0
0
0
0
1
1
)
(
z
y
x
z
y
x
z
y
x
v
R
x
q
q
q
q
q 
v
v
v
v
v
v
v
v
v
v
v
M
TRS
TR
T
RS
R
S
=
=
=
=
=
=
=
TRSM =
TRSM=

![[SOLVED] CS chain CS580](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[SOLVED] Project 9-1: Monthly Payment Calculator](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
 
 
Reviews
There are no reviews yet.