javascript - Three.js - How to link/add a light to the camera since r69? -
since r69 pattern no longer supported (*) :
directionallight.position = camera.position;
so have tried this answer :
var pointlight = new three.pointlight( 0xffffff, 1, 100 ); camera.add( pointlight );
but light doesn't work (black out), , it's same thing directionallight
what problem ?
note : of course if light doesn't follow camera :
var directionallight = new three.directionallight( 0xffffff, 1 ); directionallight.position.set( camera.position.x, camera.position.y, camera.position.z ); scene.add( directionallight );
thanks in advance
if add light child of camera, need add camera scene, light part of scene graph.
var pointlight = new three.pointlight( 0xffffff ); camera.add( pointlight ); scene.add( camera );
three.js r.71
Comments
Post a Comment