Reputation: 13
I am new to three.js. I followed the example which used JSONLoader to load model into webGLRenderer scene. The model built on Blender JS exporter is just a cube with different materials on sides. I rotate the cube in every animating scene but the materials blending is so strange when two of the opposite faces overlay. The front face become transparent and I can see the back face only.
I have searched here and here's the similar problem, however without a answer. https://stackoverflow.com/questions/8638850/three-js-z-sorting
Upvotes: 1
Views: 658
Reputation: 4756
For some reason one of your object has flipped faces so you can apply negative scale so it will flip them again like so http://jsfiddle.net/AUjHn/1/ I replaced zmesh.scale.set( 100, 100, 100);
with zmesh.scale.set( -100, -100, -100);
so now blue looks good but red is flipped you need to split models if you want to use this fix. But best way will be fixing faces of the blue object for this you need to change vertex order in the faces of this object http://www.opengl.org/wiki/Face_Culling .
Upvotes: 0