Title: Geometric Transformation
1Geometric Transformation
2Coordinate Systems
Left-handed
Right-handed
coordinate
coordinate
system
system
33-D Vectors
- Have length and direction V vx, vy, vz
- Length is given by the Euclidean Norm V
- Dot Product VU vx, vy, vz ux, uy, uz
vxux vyuy vzuz - V U cos ß
- result is a scalar value
- Cross Product V x U vyuz - vzuy, vzux - vxuz,
vxuy - vyux - V x U - ( U x V)
- Direction of resulting vector depends on
coordinate system and order of vectors but
always perpendicular to other two vectors.
4Parametric Equation of a Line
t gt 1
Given two points P1 (x1, y1, z1), P2 ( x2,
y2, z2) x x1 t (x2 - x1) y y1 t (y2 -
y1) z z1 t (z2 - z1)
t 1
t 0
P2
t lt 0
P1
- Given a point P1 and a vector V vx, vy, vz
- x x1 t vx, y y1 t vy , z
z1 t vz - COMPACT FORM L P1 tP2 - P1
or L P1 Vt
5Equation of a plane
- Ax By Cz D 0
- Given Ax By Cz D 0 Then A, B, C is a
normal vector - Pf Given two points P1 and P2 in the plane, the
vector P2 - P1 is in the plane and A,B, C
P2 - P1 (Ax2 By2 Cz2) - (Ax1 B y1
Cz1) ( - D )
- ( - D )
0 - Alternate Form A'x B'y C'z D' 0
- where A' A/d, B' B/d, C' C/d, D'
D/d - d
- Distance between a point and the plane is given
by A'x B'y C'z D' (sign indicates which
side)
6Derivation of Plane Equation
- To derive equation of the plane given three
points P1, P2, P3 - P3 - P1 x P2 - P1 N, orthogonal vector
- Given a general point P (x,y,z)
- N P - P1 0 if P is in the plane.
- Or given a point (x,y,z) in the plane and normal
vector N then N x,y,z -D
7Plane derivation example
- Find the plane containing the points (0,0,0),
(1,2,3), and (4,5,6).
8Plane derivation example
- Find the plane containing the points (0,0,0),
(1,2,3), and (4,5,6). - 1,2,3 x 4,5,6 -3,6,-3 Normal vector
- -3x 6y - 3z D 0
- substitute known point (0,0,0)
- 000D 0
- D0
- Plane equation -3x 6y - 3z 0
9Basic 3D Transformations
- Translation
- Scale
- Rotation
- Shear
- As in 2D, we use homogeneous coordinates
(x,y,z,w), so that transformations may be
composited together via matrix multiplication.
103D Translation in Homogeneous Coordinates
113D Scale
123D Rotations
- Positive Rotations are defined as follows
- Axis of rotation is Direction of positive
rotation is - x y to z
- y z to x
- z x to y
133D Rotations
About y-axis Ry(ß)P About x-axis Rx(ß)P
143D Shears
15Mapping Homogeneous Coordinates to R3
- A transformation Tr can cause the w-component to
become non-zero - TrP Tr(x,y,z,1) (x', y', z',w) P
- PR3 (x'/w, y'/w, z'/w)
16Rotation About An Arbitrary Axis
- Situation Given an object whose vertices are
defined in the world coordinate system, rotate it
by R about an axis defined by two points, P1 and
P2. - Example moon rotating about a planet
- Strategy transform this arbitrary situation into
something specific we know how to handle
171. Translate one end of the axis to the origin
P2
Z
P2-P1 u1, u2, u3
U
P1
c
u3
- a
- b
- c
- cosß u3/a
- sinß u1/a
Y
a
ß
u2
b
u1
X
182. Rotate about the y-axis an angle -ß
Z
U
Z
a
U
c
u3
a
Y
ß
Y
u2
u2
b
u1
X
After Ry(-ß), U lies in the y-z plane
X
193. Rotate about the x-axis through an angle µ
U
- This step aligns U with the z-axis.
- 4. When U is aligned with the z-axis, apply the
original rotation, R, about the z-axis. - 5. Apply the inverses of the transformations in
reverse order.
Rx (µ) cos µ a / u sinµ u2 / u
Z
a
µ
Y
u2
X
20Rotation About an Arbitrary Axis
- T-1 Ry(ß) Rx(-µ) R Rx(µ) Ry(-ß) T P