"visibility map": Which triangles are visible and which are not?

Dear all,

I am new to Panda 3D (python) … and I really apologies for this basic post. I am trying to render a simple scene (basically it is just a deformed 3D surface with a random texture). To do so, I created my own geometry using geom Primitives (triangular mesh).

Everything works well so far and the scene is (seems to be) correctly rendered, but now I am trying to save a visibility map which could tell me which triangles/vertices are actually rendered and which one are not visible (because they are occluded, as my surface can be heavily deformed some parts of it can just be hidden by a fold).

Any help would really be appreciated. I thank you for your advices.

Regards

PS: If I can add another question here … in some circumstances the surface is heavily deformed. For the sake of clarity if you fold a poster in 3d you might see the back of the poster … Is it possible to have a colour for the “back faces” of the mesh rather than see-through or the same colour as the front face …to do so, am I obliged to create a second mesh. This is probably a silly question and I am sure I am missing something but I did not find any answer in the forum and do not see any simple solution.

I thank you again for your help.

I’m not sure about your first question, but I think that I can give an answer to your second:

In short, you can set geometry to be “double-sided”, thus rendering polygons even when they are seen from behind. Note, however, that they still have their original normals, and thus will be lit as though they’re seen from the front, I believe, which can look off.

To do this, simply call the “setTwoSided” method (see the API here for details) on the NodePath in question, like so:

myNodePath.setTwoSided(True)