mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.6k stars 35.29k forks source link

The cap of geo.faces are not rendered properly since r59. #3986

Closed HongjianLi closed 10 years ago

HongjianLi commented 10 years ago

We wrote a molecular viewer using r49, available at http://webglmol.sourceforge.jp/glmol/viewer.html. Notice the faces of plates (strands). They are properly sealed, including the cap. So you can see a "thickness" of them.

However, when we upgraded to r59, the cap is lost, as you can see at http://istar.cse.cuhk.edu.hk/iview/. Notice the faces of plates (strands). Their top and bottom faces are correctly rendered. The cap of both terminals are also correctly rendered. But the cap along the strand (the "thickness") is lost.

We have also tried r60, r61, r62dev, and replaced Face4 by two Face3. The same problem remained.

gero3 commented 10 years ago
    mesh.doubleSided = true;

is used in iview but the syntax has changed for doublesided meshes. Now the material needs to know THREE.DoubleSide.

Instead of this:

    var mesh = new THREE.Mesh(geo, new THREE.MeshLambertMaterial({ vertexColors: THREE.FaceColors }));

it should be changed to this:

    var mesh = new THREE.Mesh(geo, new THREE.MeshLambertMaterial({ vertexColors: THREE.FaceColors, side: THREE.DoubleSide}));

Do this for all instances of doubleSided.

HongjianLi commented 10 years ago

Thanks thanks a lot! My problem is now solved. I spent several hours today in debugging. Probably I should have created an issue earlier.