Archived

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

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

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 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 on other sites
S1CA where could I get info on this specify subject?.

HexDump.

Share on other sites
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.

1. 1
Rutin
19
2. 2
3. 3
JoeJ
16
4. 4
5. 5

• 27
• 20
• 13
• 13
• 17
• Forum Statistics

• Total Topics
631700
• Total Posts
3001790
×