Camera Frustum Culling?

Blitz3D Forums/Blitz3D Programming/Camera Frustum Culling?

Craig H. Nisbet(Posted 2010) [#1]
Hey guys,

Disclaimer: I'm not a super hardcore math guy.

I'm trying to find a way to cull a map to the camara view for my rts engine test. I've found this article that seems to make sense for Direct X, http://www.chadvernon.com/blog/tutorials/managed-directx-2/frustum-culling/ I'm just not sure how to convert it to Blitz 3d.

The idea in the article is that you make vecters that represent the normals of planes on the right, left, top and bottom of the camera. make all the normals face inword and test if object are on the positive side of all those normals and your object is in view. Seams real simple, I'm just not sure how to get the data for the comera projection. I think this is something imbedded in DirectX.

I know blitz already does this for geometry drawing, but I'm looking to do this for the logical part of engine.

Anyone have any ideas?


GIB3D(Posted 2010) [#2]
CameraProject Camera,x,y,z
ProjectedX()
ProjectedY()
ProjectedZ()

What you could do is



Zethrax(Posted 2010) [#3]
The EntityInView() function does what you're looking to do, as far as I know.


_PJ_(Posted 2010) [#4]
I don't know about CameraPicks, but EntityInView gives a positive result if the 'usually culled from rendering by default' 'back'-faces are in the camera's field of view, but the front is too close (less than the low camera range parameter) and threrefore clipped. So Essentially, you gett a positive result while the target is actually not visible.
Naturally Alpha = 0 entities are counted as "in-View", but somewhat unexpectedly, so are HIDDEN entities.
However, EntityInView is at least limited by the camera range -high value. So any entities beyond this distance (accounting for Camera-Zoom parallax effects) will not be considered 'In View'