//转化为视角坐标
Vector3 viewPos = m_camera.WorldToViewportPoint(worldPos);
// z<0代表在相机背后
if (viewPos.z < 0) return false;
//太远了!看不到了!
if (viewPos.z > m_camera.farClipPlane)
return false;
// x,y取值在 0~1之外时代表在视角范围外;
if (viewPos.x < 0 || viewPos.y < 0 || viewPos.x > 1 || viewPos.y > 1) return false;
return true;
06-08
1597
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)