线框立方体几何

时间:2013-11-07 10:58:26

标签: javascript three.js

我刚刚从r59升级到r62并注意到线框CubeGeometry现在在每张脸上都渲染了一条额外的对角线。有办法解决这个问题吗?

volumeGeometry = new THREE.CubeGeometry(w, h, depth);
volumeMaterial = new THREE.MeshBasicMaterial({
      color : 0x0099ff,
      wireframe : true
    });
volumeMesh = new THREE.Mesh(volumeGeometry, volumeMaterial);
scene.add(volumeMesh);

2 个答案:

答案 0 :(得分:9)

如果你想要的只是一个简单的线框立方体,你可以这样做:

var cube = new THREE.BoxHelper();
cube.material.color.setRGB( 1, 0, 0 );
cube.scale.set( 10, 10, 10 );
scene.add( cube );

答案 1 :(得分:1)

来自shape example

var points = shape.createPointsGeometry();
var line = new THREE.Line( points, new THREE.LineBasicMaterial({
            color: 0xffffff
        }));
scene.add(line);