Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLM - Calculating the frustum from the projection matrix

Tags:

opengl

frustum

GLM provides a way to declare a projection matrix:

projectionMatrix = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 1000.f);

From this, I want to be able to check to see if bounding boxes are in my frustum. How do I obtain the frustum planes or whatever it is I would need to calculate this from the projection matrix? Is this even the correct way to do it?

like image 836
Pladnius Brooks Avatar asked Aug 02 '12 02:08

Pladnius Brooks


1 Answers

This will help: http://crazyjoke.free.fr/doc/3D/plane%20extraction.pdf

Also notice that in order to extract the frustum you will need to extract it using model and view matrix as well otherwise you need to apply model and view transformation on the bounding boxes in order to perform the test.

like image 75
brano Avatar answered Oct 31 '22 22:10

brano