Topic: How to check object visibility?
I need to detect events - "object appear on screen" and "object dissapear from screen".
Can you advise the best way to do this?
Currently my plan is check object-visible in onSceneUpdate() by next algorythm:
1. Find camera look direction => vec3_A
2. Find vector from cameraPosition to objectPosition (center) => vec3_B
3. Find angles between vec3_A and vec3_B and compare with angles defined by camera fov/screen width and height.
It's a dirty algorythm with "unknow visible state" zone and can be improved by cheking all BBox-vertices (inaccessible yet) instead of center.
P.S. I don't need accurate detection.
P.P.S. Next step is visible level, e.g. 1 - object under cursor +-, 0.8 - object near cursor, 0.4 - object near screen border, 0 - object invisible.
Last edited by Aikon (2013-12-14 20:29:00)