CS 184: COMPUTER GRAPHICS
Lecture #5 -- We: 2/3, 1999.
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Preparation:
Read: Ch 5 "Geometrical Transformations"
Lecture Topics
Crucial Items from Last Lecture
Why do we have so many coordinate systems ?
Convenience; separation of concerns; do each task in its most appropriate
frame.
2D Transforms: Matrices, Homogeneous Transforms, Composition.
STUDY: Ch 5.1 - 5.6 "Geometrical Transformations"
Transformations are a key element of computer graphics !
2D Point Transformations
One possible interpretation of transformations:
An operation on an object as seen
from world coordinate system,
or (in general) from coord system
that makes the instance call
(also referred to as "command post"
or "bird's eye view.")
Demo with coordinate systems overlays on overhead:
Show basic operations; emphasize reference point that remains fixed.
Demonstrate effect of consecutive transformations,
Transformations are executed in the order stated !
Order of sequence is important !
Matrix Representation of Transforms
-> Representation of Transforms with Matrices
This is the internal mathematical representation in your graphics program.
Powerful manipulation formalism exists for
automatically combining the effects of several transformations:
Matrix multiplication ! Example: Scaling.
-> Review derivation of Rotation Matrix
Homogeneous Coordinates
-> Do Translation with Matrices
Not straight-forward. Need clever hack via homogeneous coordinates.
Introduction of concept:
Linear transforms {T(aX + B) = a T(X) + b } always leave origin in place;
T(0) = 0.
Homogenizing = introduce a fourth component: w
Can obtain regular cartesian coordinates by a division with w.
This corresponds to a cut of the homogeneous line with w=1 plane
Matrix is still homogeneous in d+1 dimension,
but we are only interested in submanifold w=1,
and if we change z-scaling, it will change penetration point of homline
...
Show the basic translation matrix, demo that it works.
->2D transforms for use with homogeneous column vectors
Rigid-body xforms (rotate and translate) and
Affine xforms (scaling and shear).
Other issues of representation of transformations:
Ease of Composition: -- without having to separate out translation
part.
Efficiency: number of arithmetic ops: --homogeneous matrix may
not be best !
Abstraction from Implementation: however it is done -- hide
it from user !
(e.g., row vectors versus column vectors).
Row Vectors versus Column Vectors
Matrix representation: for row or column vectors differs by a transposition.
Row vectors have the advantage that subsequent transformation matrices
can be concatenated on the right (post multiplication)
-- but book uses column vectors...
It is important to be able to abstract from such details, thus ...
here is a more abstract terminology: distinguish OUTSIDE and INSIDE
multiplication:
Subsequent transforms from WORLD view - "Command Post View", "Bird's
Eye View":
==> Do composition from the OUTSIDE.
Distinguish from TURTLE view (discussed later), which uses INSIDE multiplication.
Applications of Composite Transformations:
(Read Ch. 5.3)
Rotation or scaling about an arbitrary point: (Fig. 5.8)
-- translate to oirigin, do desired operation, translate back to old
place.
Synthesizing a shear transformation:
-- put diagonal of parallellogram on x-axis, scale y to get right angles,
rotate back to axial position, scale to original; now do all these
operations in reverse.
The (world-)window to viewport transformation: (Fig 5.11, 5.12)
Seen here as operations (on row vectors).
(-- later we will also view this as change of coordinate basis).
Application of concatenated transforms
Window to Viewport transformation including clipping (column vectors).
Commutativity of Transformations
We have used associativity of matrix multiplications, but ...
Demonstrate order dependence.
When do transforms commute ? : T,T S,S
R,R R,uS
Examples when they do NOT commute: T,R T,S
Hierarchical (Multilevel) Assemblies
Remember example with FlowerPot on WindowSil in HouseFacade, on SceneHill
...
NOW we want to make dynamic changes in such assemblies
(need a more dynamic secene: sailor and flag on ship on rolling waves).
-> Overlays: Wave - Ship - Mate - Flag
Current Homework Assignment:
ASG#2:
"Fish into Fowl"
DUE: Monday 2/8/99, 11:59pm.
--> Next
Lecture
<-- Up to CS
184 HomePage
Page Editor: Carlo H. Séquin