Jump to content
  • Advertisement

Archived

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

jgarcia

Calculating the frustum

This topic is 5510 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

Hi all, I''m developing a Quake 3 bsp file reader ( with Opengl ), and now I''m hang evaluating the boundig boxes of clusters with the frustum to see if this cluster is visible from my eyes. I research about that and found that if I multiply the projection matrix and the modelview matrix I''ll obtain the clipping points of my frustum, then, making a simple substraction I''ll obtain the ecuation of the six planes. Ok, now I''m now how but I want to know WHY ????? Regards, J.Martin

Share this post


Link to post
Share on other sites
Advertisement
If u wand to know why u shoud read about the whole projection process but i''ll try to make it easier.The projection process goes something like that:

local coords * modelview(world) matrix = world coords
world coords * projection matrix = clip coords

clip coords / perspective divider = device coords

We need the first 2 operations only.Now since your objects are multiplied by the world matrix i.e transformed u shoud also find the transformed(rotated,translated etc) clipping planes.That''s why we mult the both matrices.Now when u extract the six planes they will be rotated,translated etc and u can compare objects to them.Try not to mult by world matrix and check the results.

"Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR

Share this post


Link to post
Share on other sites
Minor nitpick, the modelview matrix transforms to eye space, not worldspace. If you neglect the "view" part, you get world space.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!