My code is set up to create a unique diamond shape in Three.js:
var material = new THREE.MeshPhongMaterial({color: 0x55B663, side:THREE.DoubleSide});
var geometry = new THREE.Geometry();
geometry.vertices.push(new THREE.Vector3(0, 1, 0));
geometry.vertices.push(new THREE.Vector3(0, -1, 0));
geometry.vertices.push(new THREE.Vector3(-1, 0, -1));
geometry.vertices.push(new THREE.Vector3(1, 0, -1));
geometry.vertices.push(new THREE.Vector3(1, 0, 1));
geometry.vertices.push(new THREE.Vector3(-1, 0, 1));
geometry.faces.push(new THREE.Face3(0, 4, 5));
geometry.faces.push(new THREE.Face3(0, 3, 4));
geometry.faces.push(new THREE.Face3(0, 2, 5));
geometry.faces.push(new THREE.Face3(0, 2, 3));
geometry.faces.push(new THREE.Face3(1, 4, 5));
geometry.faces.push(new THREE.Face3(1, 3, 4));
geometry.faces.push(new THREE.Face3(1, 2, 5));
geometry.faces.push(new THREE.Face3(1, 2, 3));
This is how I have my lighting setup configured:
var light = new THREE.PointLight(0xffffff);
light.position.set(100,200,100);
scene.add(light);
light = new THREE.DirectionalLight(0xffffff, 1.0);
light.position.set(0, 0, 0);
scene.add(light);
light = new THREE.AmbientLight(0x404040);
scene.add(light);
Unfortunately, when the scene is rendered, only the ambient lighting seems to be working:
However, if I switch my custom diamond geometry for a standard cube, everything works perfectly:
var geometry = new THREE.BoxGeometry(1, 1, 1);
I'm puzzled as to why the lighting effects are not being applied to my custom diamond geometry?