- This topic has 1 reply, 2 voices, and was last updated 2 years, 11 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › Determine Visibility of Objects in the Scene
Tagged: Linux_ubuntu, SOFA_2106, visual
Hi!
I would like to do two things:
– Create a semantic segmentation of the rendered SOFA scene from a camera. So for each pixel I want a label of which object is visible in this pixel.
– Determine the number of points in a mesh that are visible in the camera.
I guess both of these should have a similar solution, that’s why I only created one topic.
Do you have any tips or ideas? 🙂
Cheers,
Paul
Hello @Scheikl,
1 – You may have a look at the picking part (i.e class PickHandler) where raycasting is used to identify one pixel = one state. But it could be expensive in your case I suppose. One other idea (I think it was implemented in the past but I dont really remember why it was not used anymore) is to draw your meshes each with a different color, get back the color buffer (with a FBO) and read the pixels (where you can do the mapping color = object).
2- We dont do that in SOFA but I suppose the easiest way would be to get the modelview and the projection matrices, and then use those to get the NDC of your positions and test if (X,Y) is [-1, 1].
Fred
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.