opengl3dgeometrycomputational-geometryfrustum

Coordinates of frustum corners


A method for extracting the 6 plane equations of a viewing frustum given by a MVP matrix is given by this. It there a similar method known for getting the world space coordinates of its 8 corner points, directly out of the 4x4 MVP matrix and without using trigonometry?


Solution

  • Solved it by multiplying the projected coordinates of the frustum corners e.g. (1, -1, -1) with the inverse MVP matrix.

    Edit:

    If an OpenGL-type projection matrix P is used, the coordinates c of the frustum's corners in model space are (±1, ±1, ±1) (inside the frustum each coordinate goes from -1 to +1).

    The corresponding coordinates in world space can be calculated as (P * V * M)^(-1) * c. (in homogeneous coordinates)