1

How can I check if a vertex in a model can be seen by a camera or if it's hidden behind another object?

I aim to use that information to find the coordinates and size of a bounding box that would be drawn around an object viewed from a camera, then save that bounding box's info in a text file (which is already done and working).

I do not need nor want the vertexes to be selected, I simply want their position and if they can be seen by the camera. That way, I can check for the highest and lowest vertexes as well as the most left and most right vertexes and use these coordinates to create my bounding box.

Thanks!

mgrandmont
  • 35
  • 6
  • 1
    There is a [Scene.ray_cast](https://docs.blender.org/api/current/bpy.types.Scene.html?highlight=ray_cast#bpy.types.Scene.ray_cast) function, you can send a ray at each vertex and check if it collides with your object. Unclear what you're tryong to do though, it may be that all vertices are out of camera view but polygons are visible - e.g. when you're extremely close to polygon and facing it directly. – keltar Aug 17 '18 at 05:33
  • I'll see what I can do with this. That kind of situation most likely won't happen, but it's good to know. – mgrandmont Aug 17 '18 at 15:07

0 Answers0