# Must light helper be added directly in scene?

Following method of adding light helper works ok:

var light = new THREE.SpotLight( 0xFFFFFF );
light.position.set(100,100,100);
var helper = new THREE.SpotLightHelper( light );


but following will cause helper to be off position:

var wrapper = new THREE.Object3D();
wrapper.position.set(100,100,100);
var light = new THREE.SpotLight( 0xFFFFFF );
var helper = new THREE.SpotLightHelper( light );


It seems like helper position is taken from absolute light position to scene, but is then applied from it's wrapper, that means it is actually applied twice a thus doesn't match actual position of the light. In this example, helper would appear on (200,200,200). Same applies for PointLight and probably other light types.

Is it possible to put helpers into wrapper together with light and avoid position problem?

demonstration: http://jsfiddle.net/wfpxdw37/24/

• Which version of Three.JS? Also please create a jsfiddle recreating the issue. Dec 1, 2014 at 19:23
• @ClassicThunder I was referring to current revision 69, but problem is apparently present in r54, which is the only one available in jsfiddle. jsfiddle.net/wfpxdw37/24
– lot
Dec 1, 2014 at 20:16
• @lot you can use r69 on codepen, and in r69 it appears that you can set the helper matrix to the light matrix (whereas in r54 it didn't seem to take). Dec 2, 2014 at 17:07
• @XGundam05 According to creators of THREE.JS it is not possible at this moment and light helpers must be added to scene directly. How would your solution work? I am not skilled much with matrices...
– lot
Dec 2, 2014 at 18:04
• Something akin to this. That sets the helper matrix to point to the light matrix, which has values relative to the wrapper space. I'm not certain how the helper originally calculates it's matrix, nor can I guarantee it won't break in future iterations, but for now it appears to work. Dec 2, 2014 at 18:39