CS 184: COMPUTER GRAPHICS
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
MIDTERM EXAM will be on Tuesday, November 9, in class.
Lecture #16 -- Th: 10/21, 2004.
Hand in your Quiz #2 for re-grading and credit for make-up points
Review: Mathematics of Perspective
Mathematics
of Planar Geometric Projections
Conceptually, the geometry gets scaled in X,Y with a factor that depends on the value of Z .
Rather than changing the X,Y values, we can alter the W value inversely.
In the perspective transformation, the view frustum of interest gets suitably distorted to become the canonical half-cube.
In this transformation the appropriate Z-dependent scaling in X and Y happens automatically:
Camera
Specifications and Mapping of the Viewing Volume into the Canonical Half-Cube.
YES - the bottom panel of these notes pages is correct!
We need all four transformation steps to obtain the proper perspective warp for the whole volume
-- not just the segment on the z-axis (I overlooked the -1 termin the final composite matrix!).
The crucial step is the second one: the Shear operation on W -- because that achieves the z-dependent scaling!
The other steps are just to get the geometry in the proper place so that this Shear of W along Z does the right thing:
It needs to leave the Back Clipping plane un-scaled ( w-shear should be zero; so this face should be at z=0 for this step).
The front face must be scaled from size A to unity ( a w-shear of -1 will just do this!).
Step 3, the scaling of z by the amount -A/(1+A) is designed to be just right, so that
the final shearing step, which buts the Back Clipping plane back at z=-1, will then place the Front Clipping plane at z=0.
Study the little demo: perspective_new.slf
Perspective and Clipping in 3D (Assignment #6)
Many reasons for clipping are the same as in 2D case:
avoid unnecessary work, avoid clutter, don't overflow raster memory
...
But there are some new potential problems that make clipping really
essential
(and we can't even defer it to the very end, and just do it in 2D !)
Perspective
images of line segments
Study the various cases where the endpoints of a line segment may lie:
1.) Both in front of the eye: ==> OK
2.) Both behind the eye: ==> No problem; but do we want to see this
?
3.) One in front, one behind: ==> Problems! Image goes through infinity!
Clipping is crucial.
On the other hand you can see the point at infinity of the original
line: This is the "Vanishing Point"
(Examples
?)
Various Clipping Options
1.) Do it in z first, to avoid above wrap-around problem, and then do more
clipping later in 2D;
This is conceptually plausible, but inelegant, since
it involves two different clipping steps.
2.) Do it in 3D on the canonical view frustum;
This is doable, but it involves more complex expressions for the sides of the frustum.
3.) Do
it in 4D in the space of the homogeneous coordinates;
This is the most elegant and most efficient solution (fewest divisions!),
and it has very simple arithmetic associated with it (can be done in hardware!).
Conceptually, we just use two cameras! (Because we have two eyes).
We can do it all within SLIDE -- no need to write C++ code!
Just set up two identical copies of a camera some distance apart (corresponding
to eye separation)
and have them look at the same object.
With the right kind of display hardware (polarizing filters, switched
stereo glasses),
you could project the images for the right eye and the left eye to
roughly the same spot,
and then you would see a combined image floating in space roughly at the distance of the screen.
On an ordinary display, you have to display the two images side by
side.
If you put the image for the right eye on the left, and vice versa,
then the viewing frusta will cross in front of the screen,
and the virtual object will appear within this crossing zone in front of the screen.

Vanishing Points and Vanishing Lines
The vanishing point is the perspective image of the point where a bundle
of parallel lines seem to converge. (Example:
Road)
We can find
this point by shooting a ray in the direction of the parallel bundle
and finding its intercept with the imaging plane.
Ray bundles parallel to the imaging plane do not have vanishing
points!
If you have multiple bundles of parallel lines in the same plane,
then all their vanishing points form a vanishing line (or a "horizon")
-- example:
"2-runway airfield".
Vanishing line = "horizon" of a plane = collection of the vanishing
points of all the lines in the plane.
Parallel planes have the same vanishing line.
To find
their vanishing line, pick the one through eye point and find intersection
with imaging plane.
n-Point Perspectives
Art schools make a big fuss about drawing worlds with 1-,
2-, or 3-point perspectives,
showing the corresponding number of vanishing points for bundles of
parallel lines.
However, this really only makes sense for "brick" worlds with three
sets of dominant directions.
In worlds with more than 3 major directions in which we find many edges,
each such bundle of parallel lines, can, and typically will, produce
its own vanishing point.
The only situation when such a bundle does not produce a vanishing
point is when it lies parallel to the imaging plane.
Thus an octahedron
with 6 pairs of parallel edges can have 6 vanishing points,
and can thus be rendered in "6-point perspective" !
What is the minimum number of vanishing points that it can produce
?
-- Well, it can be oriented in such a way that one of its triangular
faces lies parallel
to the imaging screen;
then 3 parallel bundles do not have a vanishing
point, and there remain only three.
Similarly, an icosahedron
(20 triangles) with 15 pairs of parallel edges can have
a maximum number of 15 vanishing points and a minimum number of 12.
What are the maximum and minimum number for a hexagonal prism
?
or for a dodecahedron
... ?
Reading Assignment:
Study: 2ndEd: Ch 7.8 - 7.10,
Study: 3rdEd: Ch 8.9 - 8.11,
Current Homework Assignment:
ASG#6:
"Perspective Projections and Stereo Viewing"
TO BE DONE with a NEW PARTNER !
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Page Editor: Carlo H. Séquin