Advertisement Jump to content
Sign in to follow this  
uglybdavis

World Space Frustum Culling?

This topic is 1863 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 Guys,

 

I'm trying to implement frustum culling. I'm currently following this tutorial:

http://www.racer.nl/reference/vfc_markmorley.htm

 

Now correct me if i'm wrong, but extracting the frustum planes from proj * view will result in the frustum planes in eye-space.

So, in order to test a point against that frustum said point would also have to be in eye space (point * view * proj), right?

Assuming that the above statement is correct, would it not make more sense to simply extract the frustum planes in world space?

 

I tried to extract said planes in world space by building the following matrix

glm::mat4 worldFrustum = cameraWorldTransformMatrix * projectionMatrix;

 

However, extracting the planes from that matrix & running the intersection tests from the above article yield some wrong results.

 

Is my math correct? Can anyone give any insight?

I can post some code if needed.

Share this post


Link to post
Share on other sites
Advertisement
Now correct me if i'm wrong, but extracting the frustum planes from proj * view will result in the frustum planes in eye-space.

 

No, it extracts the planes in world coordinates. That's why the point check in the tutorial is so simple.

 

The planes in eye coordinates are actually quite simple, since they are the faces of the unit cube.

Edited by sgt_barnes

Share this post


Link to post
Share on other sites

Thanks for clearing that up! I guess i messed up elsewhere in my code then.

Just to double check, the view matrix is the inverse of the camera's world transform, correct?

 

Thanks again!

Share this post


Link to post
Share on other sites

Camera's world transform doesnt make sense. There is world and view/camera space.  If  you mean the camera's world orientation (treating the camera as an object that could be seen in the world, then the view matrix to draw from that camera is the inverse of that, or simply the transpose. I don't recall of the top of my head.)

Share this post


Link to post
Share on other sites

Inverse of the camera's world space transform is the view matrix. That inverse can be simplified by taking the transpose of the rotation part and negating the translation part.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!