Skip to content

Instantly share code, notes, and snippets.

Frustum Camera::CalculateFrustum(float fnear, float ffar) {
Frustum returnFrustum;
// Calculate the near and far plane points
float nearHeight = 2 * tan(fov / 2) * fnear;
float nearWidth = nearHeight * aspect;
float farHeight = 2 * tan(fov / 2) * ffar;
float farWidth = farHeight * aspect;
// And their centers