vinoton / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

"Backside" of polygons not displaying #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
You can see here:

If you look at the "bottom" of the vase there, it is rendering; but if you look 
through the "top" or "opening" of the vase, you can see the bottom of the base 
is not rendering.

Is there a way to make the "backside" of the polygons the same as the 
"frontside" or render them as black or something?

Original issue reported on code.google.com by geoffgol...@gmail.com on 4 Aug 2014 at 5:00

GoogleCodeExporter commented 9 years ago
http://geoffgolder.com/cerros.html#

Original comment by geoffgol...@gmail.com on 4 Aug 2014 at 5:00

GoogleCodeExporter commented 9 years ago
Oh, the back faces there are culled. You can change the default behaviour by 
adding the following lines immediately after the initilization codes of the 
viewer:

  viewer.onloadingcomplete = function() {
    var scene = viewer.getScene();
    if (scene) {
      scene.forEachChild( function(mesh) {
        mesh.isDoubleSided = true;
      } );
    }
  };

This marks all parts of the model to be double-sided, when the loading is 
complete, which tells the viewer to disable back-face culling on them. 

Original comment by Humu2...@gmail.com on 5 Aug 2014 at 2:53

GoogleCodeExporter commented 9 years ago
Awesome.  

Original comment by geoffgol...@gmail.com on 8 Aug 2014 at 4:35

GoogleCodeExporter commented 9 years ago
The Florida museum of natural history also thanks you!

Original comment by JeffreyV...@gmail.com on 11 Aug 2014 at 2:56

GoogleCodeExporter commented 9 years ago
Really glad to hear that! It's my pleasure!

Original comment by Humu2...@gmail.com on 12 Aug 2014 at 2:54