面孔没有背部

时间:2012-12-23 17:51:31

标签: javascript three.js

我有那段代码:

var roofGeometry = new THREE.Geometry();

roofGeometry.vertices.push(
    new THREE.Vector3(-0.5, 0, 0.5),
    new THREE.Vector3(0.5, 0, 0.5),
    new THREE.Vector3(0, 1, 0.5),
    new THREE.Vector3(0.5, 0, -0.5),
    new THREE.Vector3(0, 1, -0.5),
    new THREE.Vector3(-0.5, 0, -0.5)
);
roofGeometry.faces.push(
    new THREE.Face3(0, 1, 2),
    //new THREE.Face4(1, 3, 4, 2),
    new THREE.Face3(5, 3, 4)/*,
    new THREE.Face4(0, 5, 4, 2)*/
);
//...

http://jsfiddle.net/jFyFJ

为什么旋转时三角形会消失?

1 个答案:

答案 0 :(得分:2)

在材料中使用side: THREE.DoubleSide

jsfiddle