meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
250 stars 44 forks source link

Rendering back faces #146

Closed markisus closed 5 months ago

markisus commented 1 year ago

Looks like back faces are not being rendered by default. Is there an option to render them? I have a mesh that is not water-tight and when looking from behind, parts of it disappear.

jwnimmer-tri commented 8 months ago

The front/back/both is a property of the material you're assigning to a mesh: https://threejs.org/docs/#api/en/materials/Material.side

One way to do that is a separate geometry & material, with the material specifying a side; see e.g. meshcat/test/transparent_ellipsoid.html.

With a _meshfile_object like a glTF mesh, the material sided-ness is part of the asset; see e.g. meshcat/test/opacity.html.