Imagine a 3D GameObject, which for simplicity could be a Cube. And imagine I got a point of it’s surface.
How to check if that point is visible from camera? If I pick a point that is lying on the side of cube which is visible to camera then the camera sees it obviously. But if I pick a point which is on the opposite side of the cube, which is not visible to camera because that part of cube is not facing the camera, then point is not visible. Even though all the points of cube are projected into camera view.
I could use the:
cam.WorldToViewportPoint(point)
And perform checks if point is visible in camera or not, but this won’t work if I’m selecting point that is on the side which is not visible.
For example let’s say the image above is what I’m observing from the camera. Then any point picked from the surface of 0,1 and 2 would be visible. And any other points from surfaces 3,4 and 5 are invisible.