# Confused with frustum creation

This topic is 4240 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I am currently trying to create a (view) frustum. I know this can be done with the combined modelview-projection matrix, however in Eric Lengyel's book I found another approach: The view frustum planes are always the same in camera space and can be calculated by these formulas:
Near plane = (0,0,-1,-n)
Far plane = (0,0,1, f)
Left plane = (e/sqrt(e*e + 1), 0, -1/sqrt(e*e+1), 0)
etc.

where 'e' is the focal length of the camera, 'n' the near plane distance and 'f' the far plane distance. To transform these planes from camera to world space for Frustum Culling, I need the inverse of the camera matrix. The camera matrix is a LookAt()-matrix. As planes are transformed by the inverse, transpose of a matrix, the matrix for transforming the planes from camera to world space is the inverse of the inverse, transpose of the camera matrix, which is seems to be the camera matrix itself. Here is my first problem: I transform the planes with the camera matrix and it works, but should not this be the transpose camera matrix? And the second one: When I compare the planes from the modelview-projection matrix and the transformed planes, there are slight differences, e.g. for the top plane:
Transformed Plane = (0.170789, -0.47821, -0.861479 12.3345)
ModelviewProjection Plane = (0.0665388, -0.186309, -0.980236, 8.0285)

The culling seems to work anyway, but the points and objects get culled out a little later with the transformed planes. The weird thing is that near and plane plane are the same in both cases, only the other four planes have differences. Is anybody using the transformed planes sucessfully? Or shall I stick with the planes from the modelviewprojection matrix? Thanks, Enrico

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011384
• ### Who's Online (See full list)

There are no registered users currently online

×