I’m really confused about OpenGL’s modelview transformation. I understand all the transformation processes, but when it comes to projection matrix, I’m lost 🙁
If I have a point P (x, y, z), how can I check to see if this point will be drawn on a clipping volume defined by either by parallel clipping volume or perspective clipping volume? What’s the mathematical background behind this process?
Apply the model-view-projection matrix to the object, then check if it lies outside the clip coordinate frustum, which is defined by the planes:
So if you have a point
pwhich is a vec3, and a model-view-projection matrix,M, then in GLSL it would look like this: