I’m trying to hide some meshes (box and sphere) when a single-face plane (disc) mesh become invisible (tilt camera). I’ve tried the similar example from this forum but it didn’t work for me.
It’s very similar to what you were doing, but I’m using the forward value of the disk mesh instead of the calculating it by the relative position of the mesh. The problem with using relative position is that you want to use vector component that is perpendicular to the plane.
I did tried .forward - but without success, because I missed that the .forward is in the world space, and I wrongly assumed that it is in the local space.
I just noticed that there is a problem when moving camera up. The dot remains positive while the disk is hidden. It’s easy to reproduce - just set disk at the center almost horizontally (so its barely visible) and zoom out, then move the viewport up (with right mouse button) above the eyepoint so the disk disappears - other objects remain in scene and dot remains unchanghed.
Thank you
P.S. I’m not sure that the simple dot comparison can make that magic. I think this approach is valid only to check if the mesh is visible against the near plane of the frustum indeed. Probably, there should be check against viewport bounds.