Title: Transformation
1Transformation Projection
Proseminar Computer Graphics
2Transformations
- What is a transformation?
- What kind of transformations are there?
- How can we compute them?
3Transformation
- 2D Transformations
- Homogeneous Coordinates and Matrix Representation
of 2D Transformations - Matrix Representation of 3D Transformations
- Transformations as a Change in Coordinate System
42D Translations.
52D Scaling from the origin.
62D Rotation about the origin.
72D Rotation about the origin.
y
P(x,y)
P(x,y)
r
?
y
r
?
x
x
82D Rotation about the origin.
Substituting for r
Given us
92D Rotation about the origin.
Rewriting in matrix form gives us
10Transformations.
- Translation.
- P?T P
- Scale
- P?S ? P
- Rotation
- P?R ? P
- We would like all transformations to be
multiplications so we can concatenate them ?
express points in homogenous coordinates.
11Homogeneous coordinates
- Add an extra coordinate, W, to a point.
- P(x,y,W).
- Two sets of homogeneous coordinates represent the
same point if they are a multiple of each other. - (2,5,3) and (4,10,6) represent the same point.
- At least one component must be non-zero ? (0,0,0)
is not allowed. - If W? 0 , divide by it to get Cartesian
coordinates of point (x/W,y/W,1). - If W0, point is said to be at infinity.
12Homogeneous coordinates
- If we represent (x,y,W) in 3-space, all triples
representing the same point describe a line
passing through the origin. - If we homogenize the point, we get a point of
form (x,y,1) - homogenised points form a plane at W1.
13Translations in homogenised coordinates
- Transformation matrices for 2D translation are
now 3x3.
14Concatenation.
- We perform 2 translations on the same point
15Concatenation.
Matrix product is variously referred to as
compounding, concatenation, or composition. This
single matrix is called the Coordinate
Transformation Matrix or CTM.
16Homogeneous form of scale.
Recall the (x,y) form of Scale
In homogeneous coordinates
17Concatenation of scales.
18Homogeneous form of rotation.
193D Transformations.
- Use homogeneous coordinates, just as in 2D case.
- Transformations are now 4x4 matrices.
- We will use a right-handed (world) coordinate
system - ( z out of page ).
20Translation in 3D.
Simple extension to the 3D case
21Scale in 3D.
Simple extension to the 3D case
22Rotation in 3D
- Need to specify which axis the rotation is about.
- z-axis rotation is the same as the 2D case.
23Rotation in 3D
- For rotation about the x and y axes
24Transformations of coordinate systems.
25Transform Left-Right, Right-Left
Transforms between world coordinates and viewing
coordinates. That is between a right-handed set
and a left-handed set.
26Projections
- Perspective Projection
- Parallel Projection
27Planar Geometric Projections
- Standard projections project onto a plane
- Projectors are lines that either
- converge at a center of projection
- are parallel
- Such projections preserve lines
- but not necessarily angles
- Nonplanar projections are needed for applications
such as map construction
28Perspective Projection
29Parallel Projection
30Taxonomy of Planar Geometric Projections
planar geometric projections
perspective
2 point
1 point
3 point
multiview orthographic
axonometric
oblique
isometric
dimetric
trimetric
31Orthographic Projection
- Projectors are orthogonal to projection plane
32Multiview Orthographic Projection
- Projection plane parallel to principal face
- Usually form front, top, side views
isometric (not multiview orthographic view)
front
in CAD and architecture, we often display three
multiviews plus isometric
side
top
33Advantages and Disadvantages
- Preserves both distances and angles
- Shapes preserved
- Can be used for measurements
- Building plans
- Manuals
- Cannot see what object really looks like because
many surfaces hidden from view - Often we add the isometric
34Oblique Projection
- Arbitrary relationship between projectors and
projection plane
35Advantages and Disadvantages
- Can pick the angles to emphasize a particular
face - Architecture plan oblique, elevation oblique
- Angles in faces parallel to projection plane are
preserved while we can still see around side - In physical world, cannot create with simple
camera possible with bellows camera or special
lens (architectural)
36Perspective Projection
- Projectors coverge at center of projection
37Vanishing Points
- Parallel lines (not parallel to the projection
plan) on the object converge at a single point in
the projection (the vanishing point) - Drawing simple perspectives by hand uses these
vanishing point(s)
vanishing point
38One-Point Perspective
- One principal face parallel to projection plane
- One vanishing point for cube
39Two-Point Perspective
- On principal direction parallel to projection
plane - Two vanishing points for cube
40Advantages and Disadvantages
- Objects further from viewer are projected smaller
than the same sized objects closer to the viewer
(diminution) - Looks realistic
- Equal distances along a line are not projected
into equal distances (nonuniform foreshortening) - Angles preserved only in planes parallel to the
projection plane - More difficult to construct by hand than parallel
projections (but not more difficult by computer)
41END
- Thank you for your attentions