I am currently working on setting up a lighting system for my scene to create shadows. However, I am facing an issue where changing the color of the material is not producing the desired effect of displaying shadows. Is there a way to modify the color of a MeshLambertMaterial after it has been added to the scene? And why are the light and shadows not being generated as expected? Whenever I attempt to change the color of the material, everything turns black.
Here is the snippet of code that I am using:
material = new THREE.MeshLambertMaterial( { color: "#FFFFFF",name:$scope.datosMunicipio[i].nombre} );
objMesh = new THREE.Mesh( extrude_geometrY, material );
objMesh.receiveShadow = true;
var lightAmbient = new THREE.AmbientLight(0x000000);
scene.add(lightAmbient);
var luzDireccional = new THREE.DirectionalLight(0x000000,1);
luzDireccional.position.set(1,1,1).normalize();
scene.add(luzDireccional);
objMesh.material.color.set("#FF0000"); //I want to change the color