Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
like image 890
Dan D. Avatar asked Aug 31 '25 01:08

Dan D.


2 Answers

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 );
like image 131
mrdoob Avatar answered Sep 02 '25 15:09

mrdoob


From the shape example:

var points = shape.createPointsGeometry();
var line = new THREE.Line( points, new THREE.LineBasicMaterial({
            color: 0xffffff
        }));
scene.add(line);
like image 21
Troopers Avatar answered Sep 02 '25 16:09

Troopers