-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
Description
Description of the problem
When added to the light, PointLightHelper
and SpotLightHelper
have wrong position.
Their position relative to the light is the same as the position of the light in world coordinates, which causes displacement.
You can see it in the fiddle for PointLightHelper
, the box is of size (2,2,2) and the light is displaced by 1 along the x-axis. Correct behavior would be that the origin of the marker coincides with box side, however, it is double the distance.
https://jsfiddle.net/c14r0qmt/8/
I've found that the problem comes from copying the world matrix of the original light:
this.matrix = light.matrixWorld;
this.matrixAutoUpdate = false;
https://github.com/mrdoob/three.js/blob/dev/src/helpers/PointLightHelper.js#L14-L15
https://github.com/mrdoob/three.js/blob/dev/src/helpers/SpotLightHelper.js#L18-L19
Removing those lines solves the problem
Three.js version
- r120
Browser
- Chrome