阅读:513回复:0
threejs:当物体转到一定角度,有些面消失了解决方案
在某些情况下,是因为你设置了 材质是单面渲染。
使用:side: THREE.DoubleSide.所以在转到有些面的背面后,面就不再能看到了。 例如: var rectShape = new THREE.Shape(); rectShape.moveTo( 0, 0 ); rectShape.lineTo( 0, rectWidth ); rectShape.lineTo( rectLength, rectWidth ); rectShape.lineTo( rectLength, 0 ); rectShape.lineTo( 0, 0 ); var geometry2 = new THREE.ShapeGeometry( rectShape); var material2 = new THREE.MeshBasicMaterial( { color: 0x00ff00, side: THREE.DoubleSide } ); var mesh2 = new THREE.Mesh( geometry2, material2 ) ; sceneB.add(mesh2); |
|