File:Barnstar-rotating.gif
This banner has been used for the first acknowledgement of an immense good work on the very new Czech Wikisource and has been granted to the very good and tireless user Brambůrka which I want to see her very often there. -jkb- 22:41, 24 April 2006 (UTC)
How this picture works
This picture is taken from the original barnstar: Barnstar v2.0: .
If you look at the frames of the animation, you will see that actually it only rotates through one fifth of a revolution before the animation restarts - this is to reduce file size. But the original barnstar has only approximate rotational symmetry, so you would expect a nasty discontinuous jump when it the animation restarts.
Here is the technique that was used to give a smooth transition between the end and the start of the animation.
Each frame of the animation is a linear combination (merging) of three copies of the Barnstar image with different angles of rotation.
If means the image of the barnstar rotated through angle
then image will look similar but not quite identical to where is an integer, and = 72° (i.e. the angle of rotation corresponding to the approximate rotational symmetry).
Exploiting this, for a number of values of in the range , an image is generated consisting of a linear combination of (up to) three similar images, given by:
where
The key thing about this is that not only does this fade gradually between the images as changes (as the coefficients are linear in ), but it also joins up properly when the animation restarts. You see this because the expression evaluates to the same thing for both and - in fact
I didn't keep the code unfortunately. But the above info is enough to allow someone reasonably competent to reproduce the basic algorithm.
Trainspotter again (talk) 19:57, 11 November 2009 (UTC)