I was experimenting with Three.js and attempted to create a custom mesh using the code snippet below:
var geom = new THREE.Geometry();
//geom verts
geom.vertices.push(new THREE.Vector3(-1,-1,-1));
geom.vertices.push(new THREE.Vector3(0,-1,-1));
geom.vertices.push(new THREE.Vector3(-1,0,-1));
geom.vertices.push(new THREE.Vector3(0,0,-1));
//faces
geom.faces.push(new THREE.Face3(0,1,2));
geom.faces.push(new THREE.Face3(1,2,3));
When I try to render the object, only one of the triangles shows up (the first one). Can someone please help me figure out what I'm doing wrong or provide a tutorial on creating custom meshes in Three.js without using blender? Any guidance would be greatly appreciated.