Trouble attaching objects to camera

Hi, I am trying to create a textured background that follows the camera when zooming in with the orbit controls.
Thee look I am going for is what you see when you first hit this age without zooming in or rotating with orbit controls.
http://jg-testing.herokuapp.com/test-03.1-lighting.html

However, I would like the PointLight (BulbLight) and the FloorMesh to stay with the camera when you zoom in. The answer appears to be here on this stack overflow post.

However, when I add this code,
camera.add( floorMesh );
camera.add( bulbLight );
scene.add( camera );
… instead of attaching the objects to the scene itself,
scene.add( floorMesh );
scene.add( bulbLight );

… the objects disappear.
http://jg-testing.herokuapp.com/test-03.2-lighting.html

Can anyone tell what I am doing wrong here?

If you add objects to the camera, you have to adjust their transformation (position/rotation/scale) since they are now relative to the camera. Check out the following fiddle:

1 Like

Wow @Mugen87 , thanks! that is really neat! That helps a lot. One other question relating to the bulb light. Is there any way to remove the actual white ball and still retain this lighting effect?

Try this: bulbMat.visible = false;. Or you just remove the following line:

bulbLight.add( new THREE.Mesh( bulbGeometry, bulbMat ) );

wow. thank you.