I have some 3d model meshes from .obj files, which means I have all the vertices and triangles of the mesh at my disposal. I want to find the visibility polyhedron from a point of view inside my mesh.
Doing this in 2D to a polygon was not that hard with ray casting but in 3D I face trouble. So I cast my rays to every vertex of each triangle the mesh and find which ones are visible and which ones are not. The problem is, for the triangles that are only partially visible, how do I determine which part is visible or not? I thought of a brute force kind of algorithm but it takes too much time to calculate and I don’t like the approach.
To be more specific, as a a ray is intersecting with another triangle, it means the original triangle is either not visible or only partially visible from my pov. How can I accurately determine the intersection point after which the triangle starts having visible areas? In 2D, as I found rays that go uninterrupted to a visible vertex, if I extended that ray and it intersected with an edge, it meant that this intersection point would possibly be a visible point from my pov. But in 3D I can’t think of a way to do that because, similar intersection points can have along a whole line segment of a triangle, not just a single vertex.
Any ideas?
Konstantinos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.