Reputation: 12024
In my android application I want to check if an object that is to be drawn is too far from the camera which would make it virtually invisible. This is animation application in which an object may have moved very far in the 3d space from the camera that would make the object invisible to the camera. Is there an API in OpenGL ES that would tell me if the object has gone too far from the camera to be visible? If so what is the API or possibly a set of indirect APIs that would achieve the objective?
Upvotes: 2
Views: 135
Reputation: 52093
Construct a bounding cube for your object and pass the corners through something like gluProject()
. If the rectangle covered by the resulting winX
and winY
outputs is sufficiently small, don't render.
Upvotes: 2