1

我想知道是否有一种方法可以检查相机是否正在查看 3D 空间中的 Vector3 点,或者检查该点是否显示在屏幕上。

4

1 回答 1

4

是的,只需将您的视图和投影矩阵输入到这样的边界截头体中:

//class scope variables
BoundingFrustum boundingFrustum;

//in the init method
boundingFrustum = new BoundingFrustum();

//In the Update method or wherever you need to run a check check
boundingFrustum.Matrix = view * projection;

bool isPointInView = boundingFrustum.Contains(Vector3ToTest);
于 2013-08-22T13:45:58.027 回答