Project 3d Object to Camera View
Hello everyone, I am trying to implement different methods of occlusion detection in 3D space. Lets say I want to watch one object that moves around in the scene, it might move behind a house and cannot be seen anymore. The objects in the way should then be dealt with in some way, but that is not really important here.
I have already used Raycasts to detect if there are objects in the way but I want to try using some kind of 2D Polygon representation (in the camera/view plane) of the object. I have already used a rectangle representation of objects in the camera view using the bounding box and Camera.WorldToScreenPoint
(see Documentation). To make it more accurate I thought about using the actual 2D Polygon representation of the object - my question is now: is this possible in Unity?
I could use Camera.WorldToScreenPoint
on every vertex of the meshes of the objects but then I would have to filter out the vertices that are not boundary and it would take forever for larger meshes, which would not really work (I am calling this method every Update cycle).
Your answer
Follow this Question
Related Questions
Missing shadows when using a custom oblique projection matrix 0 Answers
camera movement on a sphere 0 Answers
Cinemachine/Timeline not playing animation on Maximize on Play 1 Answer
How to hide and show level based on player/camera position? 0 Answers
Moving character depending on where the camera is facing 1 Answer