jupyter-widgets-contrib / ipygany

3-D Scientific Visualization in the Jupyter Notebook
BSD 3-Clause "New" or "Revised" License
488 stars 52 forks source link

IsoSurface: Triangle normal issues #5

Closed martinRenou closed 4 years ago

martinRenou commented 4 years ago

Triangle indices are not ordered correctly in the IsoSurface computation, resulting in the triangle normals to be randomly chosen.

Normals are important for face culling: (Using the ThreeJS default culling: THREE.FrontSide only triangles facing the camera are displayed, this depends on the triangle normal) isosurface_front

(Using THREE.DoubleSide all the triangle are displayed) isosurface_double

Concerning the iso-surface computation, we should use the THREE.DoubleSide option anyway, because the surface has no "side". But concerning the threshold computation, it will be important to get normal rights (especially for transparent meshes, because transparency depends a lot on culling).

martinRenou commented 4 years ago

Moved to https://github.com/martinRenou/GanyJS/issues/1