Blender导出obj不导出双面对象.如何在双面模式下渲染对象.我尝试了这个没有成功:
var loader = new THREE.OBJMTLLoader();
loader.load('models/test.obj');
loader.addEventListener( 'load', function ( event ) {
objects = event.content;
objects.position.set(0,5,0);
objects.scale.set(1.5,1.5,1.5);
objects.mesh.doubleSided = true;
scene.add(objects);
});
Run Code Online (Sandbox Code Playgroud)
Wes*_*ley 58
在您的情况下,您将以下内容添加到回调函数:
objects.traverse( function( node ) {
if( node.material ) {
node.material.side = THREE.DoubleSide;
}
});
Run Code Online (Sandbox Code Playgroud)
该doubleSided属性Mesh已弃用.它被替换为side属性Material
此外,最好学习使用当前版本库的three.js示例.
three.js r.57
未来的读者!只需将side选项添加到材质构造函数中即可:
const material = new THREE.MeshLambertMaterial({
color: 0xff0000,
side: THREE.DoubleSide
// ^ this line here
});
Run Code Online (Sandbox Code Playgroud)