question about projections...
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.
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:
[edited by - s1ca on May 29, 2004 4:39:26 PM]
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]
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement