简体   繁体   中英

Wireframe cube geometry

I have just upgraded from r59 to r62 and noticed that the wireframe CubeGeometry has now rendered an extra diagonal line on each face. Is there a way to fix this?

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

If all you want is a simple wireframe cube you can do this:

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

From the shape example :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM