   Next: 3D Clipping Up: Projections and Projective Previous: Why Map Z?

# Mapping Z

• It's clear how x and y map. How about z? • We know P(f)=1 and P(n)=-1. What maps to 0? Note that so • What happens as z goes to 0 or to infinity?  \

• What happens if we vary f and n?
• Not surprising, since we're trying to map a single point to a line segment.

• This means we are mapping an infinite region to [0,1] and we will effectively get a far plane due to floating point precision.

• I.e., the entire map becomes constant (again, we are mapping a point to an interval).

• What happens as f and n move away from each other.

Look at size of the regions [n,2fn/(f+n)] and [2fn/(f+n),f].

When f is large compared to n, we have So and But both intervals are mapped to a region of size 1.

Thus, as we move the clipping planes away from one another, the far interval is compressed more than the near one. With floating point arithmetic, this means we'll lose precision.

In the extreme case, think about what happens as we move f to inifinity: we compress an infinite region to a finite one.

Therefore, we try to place our clipping planes as close to one another as we can.

CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab

cs488@cgl.uwaterloo.ca