Archived

This topic is now archived and is closed to further replies.

question about projections...

This topic is 4950 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I´m coding a frustum class in order to cull objects not visible. Reading a tutorial (pretty good I should say), there''s something I don´t understand: It states that if you have a box (for example), and you transform it by the projection matrix you can test if it is inside the frustum as if the frustum were a box too, instead of a cut piramid :/. Why is this, should´t the frustum have a frustum shape?. Thanks in advance, HexDump.

Share this post


Link to post
Share on other sites
The shape of space after the projection transformation but before the perspective divide (where you divide the homogenous coordinates by W) is effectively cuboid and is known as the "canonical clipping volume".

The clipping against this new volume can be reduced to a few comparisons against W:

if ( (x>-w && x<w) &&
(y>-w && y<w) &&
(z> 0 && z<w) )
{
visible
}
else
{
not visible
}


[edited by - s1ca on May 29, 2004 4:39:26 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
By design, the view frustum is transformed by the projection matrix into a 2x2x2 cube. However, in order to avoid divide-by-0, the culling and clipping are done with homogenous coordinates as S1CA described.

Share this post


Link to post
Share on other sites