frustrum culling

Started by
1 comment, last by tHiSiSbOb 21 years, 10 months ago
Hi. I just have a simple question about frustrum culling. I have not looked at any tutorials but i had an idea about how i might do it and i wanted to know if it would work. Here goes A variable is used to rotate the view. When this value is incramented the view is changed. If the glRotatef function works like i think, then what it does is change the view according to the vale of cos(var)*(3.14/180). So if we wanted to only draw the polygons that were in our viewing frustrum then couldn''t u do something like //var is the variable used to rotate. if(vertex+45 <=(cos(var))*(3.14/180)&&vertex-45 >=(cos(var))*(3.14/180)) //Draw Stuff and something similar for the y axis.
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
Advertisement
I don''t know if that would work, but it seems calling COS() every frame would be a timely operation. Check out the tutorial at http://www.markmorley.com, it explains the process of frustrum culling very well. Then, checking vertices for visibility in the current frustrum is as simple as doing the "plane equation" using the vertex against all the planes in the frustrum (there''s six of them).
Yup.. I agree with blueEbola

I also recommend this site VERY much: http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg4.htm
Scroll almost to the bottom of the page..

Cya Halloko

This topic is closed to new replies.

Advertisement