My goal is to attach a set of DirectionalLights
offset from the ObjectControls
camera that all move with the camera as it orients around an object. This following approach is not working
I create a light and a helper:
const light = new THREE.DirectionalLight( color )
const helper = new THREE.DirectionalLightHelper(light)
I do not add the light to the scene.
I have created an objectControls subclass cameraLightingRig
. In it’s constructor I attach the light (the light is still in it’s default position and target):
this.light = light
this.object.add(light)
the light is now a child of the cameraLightingRig camera (the object property)
I pose the cameraLightingRig camera with this method:
setPose(position, target) {
this.object.lookAt(target)
const { x, y, z } = position
this.object.position.set(x, y, z)
this.object.updateMatrixWorld()
this.target.copy(target)
this.update()
};
I assume this positions the light at the camera position. Yes or no?
I have not set the light target. How does happen?
When I run the app the directional light is not at the camera position but rather of to the side.
What am I missing here?