Using AFrame and three. Have made an AFrame simple scene, a camera, a renderer, a spotlight, a plane and a cube.
I want the cube to cast shadow into the plane.
I have set, using the reference cube.object3D and spotlight.object3D, the .castShadow in the spotlight, in the cube.
I have set, using the reference plane.object3D, the receiveShadow in the plane.
Have also set the renderer.shadowMapEnabled.
But can not see any shadow casted into the plane.
Any hint ?
Thanks a lot.
many thanks for your answers.
I am learning A-Frame, Three.js, Javascript, and html just by doing.
It is awesome what you are doing with A-Frame.
Done the following, it is not perfect, but for now it works:
In the registerComponent init:function()
In the meshes to cast shadows:
el.getObject3D('mesh').castShadow = data.shadow; //data.shadow = true
In the meshes to receive shadows:
el.getObject3D('mesh').receiveShadow = data.shadow; //data.shadow = true
In the spotlight:
And then using the scene has loaded event: