Open GoogleCodeExporter opened 8 years ago
[deleted comment]
It seems as if the face normal vectors are defined in wrong directions, which
are required in rendering to detect and cull back faces. The solution is
simple: use a modeling tool such as meshlab or 3dsmax to flip the vertex
normals and regenerate the stl files to fix this issue.
If it is not convenient to fix the models manually, you can add the following
short snippet immediately after the initialization of the viewer:
viewer.onloadingcomplete = function() {
var scene = viewer.getScene();
if (scene) {
scene.forEachChild( function(mesh) {
mesh.isDoubleSided = true;
} );
viewer.update();
}
};
which marks the meshes to be double-sided to diable back-face culling. Current
implementation of the WebGL renderer has an issue in drawing double-sided
faces. So in this case this line should be removed:
viewer.setParameter('Renderer', 'webgl');
from your initialization code to let the software render work instead.
Original comment by Humu2...@gmail.com
on 8 Aug 2014 at 5:19
Sorry. In fact the WebGL renderer works fine for double-sided faces. So just
keep it please.
Original comment by Humu2...@gmail.com
on 9 Aug 2014 at 4:56
Thank you so much for this - worked like a charm!
Original comment by j...@onlinefusion.co.uk
on 11 Aug 2014 at 8:13
Original issue reported on code.google.com by
j...@onlinefusion.co.uk
on 8 Aug 2014 at 3:40Attachments: