😟 Silverlight was supported by Microsoft from 2007 to 2012 when it was announced that development had ceased and support would end in October 2021. It is now practically impossible to run the Silverlight app below, even using Internet Explorer 11. This is how it used to look, but of course the image is frozen in time and you'll' have imagine the lovely smooth hypnotic twirling balls.
CompositionTarget Rendering Animation Sample
A Silverlight 5 application that uses the CompositionTarget.Rendering
event to create a hypnotic animation effect of coloured circles moving across a
Canvas playing field. This is an expanded and more entertaining version of the app
I wrote a few weeks ago as a proof of concept that this is the correct technique
to create "long running animations". The original app only had one circle
moving at fixed speed, now you can adjust the speed and the size and count of the
circles.
The (x,y) points of each circle are calculated by a random sum of Sine functions like this:
x = s1 Sin[c1 * arg] + s2 Sin[c2
* arg] + s3 Sin[c3 * arg] + ...
y = same technique
The sn sign values are random +1 or -1. The cn coefficient values are random values from 0.5 to 6.0. This creates a long and seemingly chaotic closed path which is a kind of Lissajous pattern. The circles have random colours and they fly around the path at different argument offsets. For simplicity, the circles all have the same size and they all move at the same speed.
This app is only intended to demonstrate the lovely animation effects you can create
by listening to the Rendering
event; it has a fixed size window, it
does not use binding and it has not been globalised or localised.
The complete source is available on
Azure DevOps.
Greg (29-May-2010)
Back to: Computers Home Page
To clarify what the "seemingly chaotic closed path" looks like, below is a parametric plot generated by Mathematica V7 using randomly chosen signs and argument coefficients with 3 terms. The demo app uses 5 terms, so the path is even longer and more convoluted.