I've encountered an issue while attempting to create a square using custom Geometry in tree.js. The code snippet I'm using is:
var cubeGeo = new THREE.Geometry();
cubeGeo.vertices.push( new THREE.Vector3( -25, 25, -25 ) );
cubeGeo.vertices.push( new THREE.Vector3( 25, 25, -25 ) );
cubeGeo.vertices.push( new THREE.Vector3( -25, -25, -25 ) );
cubeGeo.vertices.push( new THREE.Vector3( 25, -25, -25 ) );
cubeGeo.faces.push( new THREE.Face4( 0, 1, 2, 3, new THREE.Vector3( 0, 0, 1 ), 0xffffff, 0) );
var cube = new THREE.Mesh(
cubeGeo,
//new THREE.CubeGeometry(50, 50, 50),
new THREE.MeshPhongMaterial({color: 0x696969, emissive: 0x696969, specular:0x696969, shininess: 15})
);
However, instead of generating a square, it creates a triangle. Could someone please help me understand why this unexpected result is occurring?