|
From: Frederic B. <fre...@fr...> - 2006-02-22 23:18:27
|
Josh Babcock wrote : > Can anyone explain to me how the flash animation works? It seems to be > undocumented and I think it is what I need. I am trying to animate some > landing light halos, and I want to make them get dim as the view gets > off-axis. > The flash animation can be found in the beacon model. <animation> <type>flash</type> <object-name>GreenFlash.1</object-name> <center> <x-m>0</x-m> <y-m>-0.35</y-m> <z-m>16.8</z-m> </center> <axis> <x>0</x> <y>-1</y> <z>0.1</z> </axis> <power>100</power> <!-- not specified - default values <factor>1</factor> <offset>0</offset> <two-sides type="bool">false</two-sides> <min>0</min> <max>1</max> --> </animation> It computes a scale factor applied to the object from the cosine of the angle between the axis provided in the animation and the view vector. : scale = factor * pow( cosine, power ) + offset scale is then clamped between min and max. and this scale factor is applied to the object, from the center specified. It works best if scale is less than 1. Otherwise, there will be clipping issues. if two-sides is false, nothing is drawn if the cosine is negative. Of course, this animation can be combined with another. In the case of the beacon, there is a rotation just before that create the current effect. -Fred |