Hi,
When adding my normal map to a plane geometry, it appears fine, but from a BufferGeometry, nothing is shown:
{
var spotLight = new DirectionalLight(0xffaaaa, 3);
spotLight.position.set(-18, 50, 78);
spotLight.lookAt(-9, 75);
spotLight.castShadow = true;
scene.add(spotLight);
const geometry = new PlaneGeometry(10, 10);
const material = //material variable
const cube = new Mesh(geometry, material);
cube.position.set(-67, 1, 130)
scene.add(cube);
}
{
const geometry = new BufferGeometry();
const vertices = new Float32Array([
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
-1.0, -1.0, 1.0
]);
geometry.setAttribute('position', new BufferAttribute(vertices, 3));
const material = //material variable
geometry.computeVertexNormals();
const mesh = new Mesh(geometry, material);
mesh.position.set(-87, 1, 130)
scene.add(mesh);
}
why the first version works fine and has the NM, but the second one not?
thanks