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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With