Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Three dimensional transformations
1.
2. 3D transformation methods are extended
from 2D methods by including considerations
for the z coordinate
A 3D homogenous coordinate is represented
as a four-element column vector
◦ Each geometric transformation operator is a
4 by 4 matrix
3. Translation of a Point
zyx tzztyytxx ',','
11000
100
010
001
1
'
'
'
z
y
x
t
t
t
z
y
x
z
y
x
P’=P·T
(x,y,z) T=(tx,ty,tz)
(x’,y’,z’)
x
z
y
4. Uniform Scaling (Scaling relative to the coordinate origin)
zyx szzsyysxx ',','
11000
000
000
000
1
'
'
'
z
y
x
s
s
s
z
y
x
z
y
x
x
z
y
P’ = S·P
5. Scaling with a Selected fixed point (xf, yf , zf)
11000
100
010
001
1000
000
000
000
1000
100
010
001
1
'
'
'
),,(),,(),,(
z
y
x
z
y
x
s
s
s
z
y
x
z
y
x
zyxTsssSzyxT
f
f
f
z
y
x
f
f
f
fffzyxfff
x x x xzzzz
y y y y
Original position Translate Scaling Inverse Translate
6. Positive rotation angles produce counterclockwise
rotations about a coordinate axis, assuming that we are
looking in the negative direction along that coordinate
axis
Coordinate-Axis Rotations
◦ Z-axis rotation
◦ X-axis rotation
◦ Y-axis rotation
General 3D Rotations
◦ Rotation about an axis that is parallel to one of the
coordinate axes
◦ Rotation about an arbitrary axis
7. Z-Axis Rotation X-Axis Rotation Y-Axis Rotation
11000
0100
00cossin
00sincos
1
'
'
'
z
y
x
z
y
x
11000
0cossin0
0sincos0
0001
1
'
'
'
z
y
x
z
y
x
11000
0cos0sin
0010
0sin0cos
1
'
'
'
z
y
x
z
y
x
8. z-axis rotation
◦ x’=x cos θ - y sin θ
◦ y’=x sin θ + y cos θ
◦ z’=z
or, P’ = Rz(θ)·P
11000
0100
00cossin
00sincos
1
'
'
'
z
y
x
z
y
x
9. z-axis rotation
◦ x’=x cos θ - y sin θ
◦ y’=x sin θ + y cos θ
◦ z’=z
Other axis rotations
◦ x→ y→ z→ x
x-axis rotation
◦ y’=y cos θ - z sin θ
◦ z’=y sin θ + z cos θ
◦ x’=x
y-axis rotation
◦ z’=z cos θ - x sin θ
◦ x’=z sin θ + x cos θ
◦ y’=y
or, P’ = Rx(θ)·P
or, P’ = Ry(θ)·P
10. General 3D Rotations : CASE 1
• Rotation about an Axis that is Parallel to One of the Coordinate
Axes
– Translate the object so that the rotation axis coincides with the
parallel coordinate axis
– Perform the specified rotation about that axis
– Translate the object so that the rotation axis is moved back to
its original position
– Any coordinate position P on the object in this fig. is transformed
with the sequence shown as below
P’ = T-1·Rx(θ)·T·P
11. Rotation about an Arbitrary Axis
Basic Idea
1. Translate (x1, y1, z1) to the
origin
2. Rotate (x’2, y’2, z’2) on to the
z axis
3. Rotate the object around the
z-axis
4. Rotate the axis to the original
orientation
5. Translate the rotation axis to
the original position
(x2,y2,z2)
(x1,y1,z1)
x
z
y
R-1
T-1
R
T
TRRRRRTR xyzyx
111
12. Step 1. Translation
1000
100
010
001
1
1
1
z
y
x
T
(x2,y2,z2)
(x1,y1,z1)
x
z
y
13. Step 2. Establish [ TR ]
x x axis
1000
0//0
0//0
0001
1000
0cossin0
0sincos0
0001
dcdb
dbdc
x
R
(a,b,c)
(0,b,c)
Projected
Point
Rotated
Point
d
c
cb
c
d
b
cb
b
22
22
cos
sin
x
y
z
14. cgvr.korea.ac.kr
Step 3. Rotate about y axis by
(a,b,c)
(a,0,d)
l
d
22
222222
cos,sin
cbd
dacbal
l
d
l
a
1000
0/0/
0010
0/0/
1000
0cos0sin
0010
0sin0cos
ldla
lald
y
Rx
y
Projected
Point
z
Rotated
Point
15. Step 4. Rotate about z axis by the desired
angle
l
1000
0100
00cossin
00sincos
zR
y
x
z
16. Step 5. Apply the reverse transformation to
place the axis back in its initial position
x
y
l
l
z
1000
0cos0sin
0010
0sin0cos
1000
0cossin0
0sincos0
0001
1000
100
010
001
1
1
1
111
z
y
x
yx RRT
TRRRRRTR xyzyx
111
17. Find the new coordinates of a unit cube 90º-rotated
about an axis defined by its endpoints A(2,1,0) and
B(3,3,1).
A Unit Cube
18. Step1. Translate point A to the origin
A’(0,0,0)
x
z
y
B’(1,2,1)
1000
0100
1010
2001
T
24. A 3-D Reflection can be performed relative to
a selected reflection axis or w.r.t selected
reflection plane. The 3-D reflection matrixes
are set up similarly to those for 2-D.
In 2-D , Reflection w.r.t axis is equivalent to
180 degree rotations about the axis in 3- D
space
whereas ,in 3-D Reflection w.r.t a plane are
equivalent to 180 degree rotations in 4-D
space.
3D Transformation 24
25. Other Transformations : REFLECTION
Reflection Relative to the XY Plane
x
z
y
x
z
y
11000
0100
0010
0001
1
'
'
'
z
y
x
z
y
x
Reflection Relative to the XZ Plane
11000
0100
0010
0001
1
'
'
'
z
y
x
z
y
x
x
z
y
x
z
y
11000
0100
0010
0001
1
'
'
'
z
y
x
z
y
x
Reflection Relative to the YZ Plane
x
z
y
z
y
x
26. Other Transformations : SHEARING
• Shearing transformation are used to modify the shape of
the object and they are useful in 3-D viewing for obtaining
General Projection transformations.
• Z-axis 3-D Shear transformation
• The effect of this transformation matrix is to alter the x and y
co-ordinate values by an amount that is proportional to the z-value,
while leaving z co-ordinate unchanged. Boundaries of the plane
that are perpendicular to z-axis are thus shifted proportional to
z-value.
11000
0100
010
001
1
'
'
'
z
y
x
b
a
z
y
x
27. X-axis 3-D Shear transformation
Y-axis 3-D Shear transformation
11000
010
0010
001
1
'
'
'
z
y
x
b
a
z
y
x
11000
010
001
0001
1
'
'
'
z
y
x
b
a
z
y
x
29. • Man-made objects often have “cube-like” shape.
These objects have 3 principle axis.
3D Transformation Slide 29
30. 3D Transformation Slide 30
• How do we map 3D objects to 2D space?
Display device (a
screen) is 2D…
• 2D window to world.. and a viewport on the 2D
surface.
• Clip what won't be shown in the 2D window, and
map the remainder to the viewport.
2D to 2D is
straight
forward…
• Solution : Transform 3D objects on
to a 2D plane using projections
3D to 2D is more
complicated…
31. • In 3D…
– View volume in the world
– Projection onto the 2D projection plane
– A viewport to the view surface
• Process…
– 1… clip against the view volume,
– 2… project to 2D plane, or window,
– 3… map to viewport.
3D Transformation Slide 31
33. PROJECTIONS
PARALLEL
(parallel projectors)
PERSPECTIVE
(converging projectors)
One point
(one principal
vanishing point)
Two point
(Two principal
vanishing point)
Three point
(Three principal
vanishing point)
Orthographic
(projectors perpendicular
to view plane)
Oblique
(projectors not perpendicular to
view plane)
General
Cavalier
Cabinet
Multiview
(view plane parallel
to principal planes)
Axonometric
(view plane not parallel to
principal planes)
Isometric Dimetric Trimetric
333D Transformation
34. • 2 types of projections
– PERSPECTIVE and PARALLEL.
• Key factor is the center of projection.
– if distance to center of projection is finite : PERSPECTIVE
– if distance to center of projection is infinite : PARALLEL
3D Transformation Slide 34
35. In perspective projection, object position are
transformed to the view plane along lines that
converge to a point called projection reference
point (center of projection)
In parallel projection, coordinate positions are
transformed to the view plane along parallel lines.
353D Transformation
36. • Perspective projection
+ Size varies inversely with distance - looks realistic
– Distance and angles are not (in general) preserved
– Parallel lines do not (in general) remain parallel
• Parallel projection
+ Good for exact measurements
+ Parallel lines remain parallel
– Angles are not (in general) preserved
– Less realistic looking
38. Perspective Projections
CHARACTERISTICS:
• Center of Projection (CP) is a finite distance from object
• Projectors are rays (i.e., non-parallel)
• Vanishing points
• Objects appear smaller as distance from CP (eye of observer)
increases
• Difficult to determine exact size and shape of object
• Most realistic, difficult to execute
383D Transformation
39. • When a 3D object is projected onto view plane using
perspective transformation equations, any set of parallel lines
in the object that are not parallel to the projection plane,
converge at a vanishing point.
– There are an infinite number of vanishing points,
depending on how many set of parallel lines there are in
the scene.
• If a set of lines are parallel to one of the three principle axes,
the vanishing point is called an principle vanishing point.
– There are at most 3 such points, corresponding to the
number of axes cut by the projection plane.
393D Transformation
40. • Certain set of parallel lines appear to meet at a different point
– The Vanishing point for this direction
• Principle vanishing points are formed by the apparent
intersection of lines parallel to one of the three principal x, y, z
axes.
• The number of principal vanishing points is determined by the
number of principal axes intersected by the view plane.
• Sets of parallel lines on the same plane lead to collinear
vanishing points.
– The line is called the horizon for that plane
Vanishing points
403D Transformation
44. Three-point perspective projection
• Three-point perspective projection is used less frequently
as it adds little extra realism to that offered by two-point
perspective projection
443D Transformation
45. Affine Transformations
• Affine transformations are combinations of …
– Linear transformations, and
– Translations
• Properties of affine transformations:
– Origin does not necessarily map to origin
– Lines map to lines
– Parallel lines remain parallel
– Ratios are preserved
– Closed under composition
w
y
x
fed
cba
w
y
x
100
'
'
46. Perspective Transformations
• Projective transformations …
– Affine transformations, and
– Projective warps
• Properties of projective transformations:
– Origin does not necessarily map to origin
– Lines map to lines
– Parallel lines do not necessarily remain parallel
– Ratios are not preserved
– Closed under composition
w
y
x
ihg
fed
cba
w
y
x
'
'
'
52. Center of projection is at infinity
◦ Direction of projection (DOP) same for all points
DOP
View
Plane
53. • We can define a parallel projection with a projection vector that
defines the direction for the projection lines.
2 types:
• Orthographic : when the projection is perpendicular to the view
plane. In short,
– direction of projection = normal to the projection plane.
– the projection is perpendicular to the view plane.
• Oblique : when the projection is not perpendicular to the view
plane. In short,
– direction of projection normal to the projection plane.
– Not perpendicular.
Parallel Projections
533D Transformation
54. when the projection is
perpendicular to the view
plane
when the projection is not
perpendicular to the view
plane
• Orthographic projection Oblique projection
543D Transformation
55. – Front, side and rear orthographic projection of an object are
called elevations and the top orthographic projection is called
plan view.
– all have projection plane perpendicular to a principle axes.
– Here length and angles are accurately depicted and measured
from the drawing, so engineering and architectural drawings
commonly employee this.
• However, As only one face of an object is shown, it can be hard to
create a mental image of the object, even when several views are
available.
Orthographic (or orthogonal) projections:
553D Transformation
57. Axonometric orthographic projections
The most common axonometric
projection is an isometric
projection where the projection
plane intersects each coordinate
axis in the model coordinate
system at an equal distance.
573D Transformation
59. Cavalier projection:
• All lines perpendicular to the projection plane are
projected with no change in length.
OBLIQUE PARALLEL PROJECTIONS :
Cavalier and Cabinet
593D Transformation
60. Oblique Projections : CAVALIER PROJECTION
• DOP not perpendicular to view plane
Cavalier
(DOP = 45
o
)
tan() = 1
61. Cabinet projection:
– Lines which are perpendicular to the projection plane
(viewing surface) are projected at 1 / 2 the length .
– This results in foreshortening of the z axis, and
provides a more “realistic” view.
613D Transformation
Oblique Projections : CABINET PROJECTION
62. Oblique Projections : CABINET PROJECTION
H&B
• DOP not perpendicular to view plane
Cabinet
(DOP = 63.4
o
)
tan() = 2
63. 633D Transformation
Remaining Topics - (REFER CLASS NOTES)
Transformation Matrix for Oblique Projection
of a 3-D point.
General Projection Transformations
General Parallel Projection Transformation
General Perspective Projection Transformation
View Volumes for Projections