I want to calculate if a 3d point is in the view frustum or not.
I have my Frustum width and height calculated.
My point has its values - px,py,pz
If I want to find the frustum width at that point's z value
would I do this:
pz * fw and pz * fh

But must I first transform this point by the camera matrix, modelview matrix, and projection matrix?

noncopyable

11-24-2007, 05:59 AM

If you use modelview and projection matrices (mvp) to extract world space frustum planes, and if your point already in world space, you are done, you don't need to transform point. There are plenty good VFC tutorials out there :)

Trenki

11-24-2007, 08:38 AM

For only testing if a point is in the view frustum it is easiest to just tranform the point with the modelviewprojection matrix and then test for -w <= x <= w, -w <= y <= w etc. to see if it is inside.

For other things you might want the extract the frustum planes from the matrix and work with those.