I have written some code to add two lights on the camera that move along with the orbitcontrols. However, the lights and spheres are not visible for some reason. Can someone help me identify the issue in my code?
var sphere1 = new THREE.Mesh( new THREE.SphereGeometry( 2000, 16, 16), new THREE.MeshBasicMaterial({color:0xff0000}) );
var cameraLight1 = new THREE.PointLight( this.options.lights.lightColor, this.options.lights.lightIntensity * 1.2, this.options.lights.lightRadious );
sphere1.add( cameraLight1 );
sphere1.position.set( -5000, -5000, -5000 );
this.camera.add( sphere1 );
var sphere2 = new THREE.Mesh( new THREE.SphereGeometry( 2000, 16, 16), new THREE.MeshBasicMaterial({color:0xff0000}) );
var cameraLight2 = new THREE.PointLight( this.options.lights.lightColor, this.options.lights.lightIntensity * 1.2, this.options.lights.lightRadious );
sphere2.add( cameraLight2 );
sphere2.position.set( -5000, -5000, -5000 );
this.camera.add( sphere2 );
When I add the spheres/lights to the scene directly, they appear fine. I am unsure why this method is not working.
PS:
Camera initial position:
{x: 0, y: 5.510910596163089e-12, z: 90000}
Update:
Even this alternative approach does not work:
var cameraLight1 = new THREE.PointLight( this.options.lights.lightColor, this.options.lights.lightIntensity * 1.2, this.options.lights.lightRadious );
this.camera.add( cameraLight1 );
cameraLight1.position.set( 0,0,-5000 );
var cameraLight2 = new THREE.PointLight( this.options.lights.lightColor, this.options.lights.lightIntensity * 1.2, this.options.lights.lightRadious );
this.camera.add( cameraLight2 );
cameraLight2.position.set( 0,0,-5000 );