Canvas Play 08: Waving The Flag

Again, this demo doesn’t add much from the last demo, but demonstrates another use of the SineOscillator. This time, it shows 1180 Orbs oscillating in a grid shape, giving an impression of a waving flag, click the image below to see it in action.

Canvas_08 Demo
[Please note that this demo hasn't been optimised to work on all machines, so you may experience some slow down]

View Source

Below, I’ve included the source code of the demo. You can have a look through all of the code properly on GitHub, but I’ll give a quick overview.

As mentioned previously, the SineOscillator uses the sine wave to oscillate the specified property between two values. This demo lays the orbs out in a grid and applies the SineOscillator behaviour to oscillate the x, y and alpha values, which gives the impression of a waving flag.

You can grab the source code from GitHub and have a play.

Posted by Mark on March 23rd, 2011
 

1 Response to “Canvas Play 08: Waving The Flag”

  • Spadar Shut Says:

    Great effect! Could you tell how to make a waving flag from a bitmap image or from a canvas-drawn three-striped flag?

Leave a Reply