mrdoob/three.js — Issue #1124: LensFlare rotation bug and fix
Author: coldi
Created: 2012-01-17 17:54:44+00:00
State: open

i think i found a little bug in LensFlare.js
when you first look at it in the scene it starts spinning around like crazy for a short time before it meets wantedRotation. this effect can be fixed if you set "flare.rotation = 0;" at the beginning of the rotation calculations on line 74:

flare.rotation = 0; // fix
flare.wantedRotation = flare.x * Math.PI * 0.35; // multiplier increased from 0.25 to 0.35 to get same amount of rotation movement as intended
flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.35;

ofcourse everyone can easy workaround if you set customUpdateCallback and fix it in an own update function... just wanted to let you guys know and for future releases :)