PDA

View Full Version : clip coordinates



09-26-2006, 07:49 AM
Hi everyone,

I'm confused about how clipping occurs using clip coordinates. For example, take these two points in clip coordinates:

p0 = -642.714 189.487 1061.82 1134.37

p1 = 557.522 -3335.33 -102.387 -1.09302

Suppose these to points are the endpoints of a line.

According to the opengl spec, points are clipped to a space that -wc lessequal cx lessequal wc (and similar for y and z).

The confusion in my mind is dealing with two points, like the ones above which have different wc values. How is that case handled ?

Bruce Merry
09-27-2006, 05:12 AM
It makes more sense if you think of clip space as an honest-to-goodness 4D space, and about the 4D-space line connecting those two points. The inequalities you mentioned define a pyramidal hypervolume in this space. The line is clipped to this hypervolume.

It's probably easier to visualise if you toss out y and z and draw a picture of (x, w) space.

09-27-2006, 08:19 AM
I think I see what you mean. Combining what you say with the reading I did last night, it seems as though the procedure is to interpolate in all 4 coordinates, in 4d essentially, and the wc is used just for calculating outcodes.