Tag: Math

Sparker

This is another fun animation from simple math. Mainly function that I use are:

  • linear equation : y = ax + b
  • Brownian
  • Circle : radius to point

For tweening between each mode was done by TweenLite and the sparking techniq
is base on flash drawing api and linear equation with some tune on the variable.

My Sparker

My Sparker

have fun 🙂

The Day The Earth Stood Still

I’ve watched this movie “The Day The Earth Stood Still” on last Sunday, the movie is ok for me, nothing really surprise but one scene in the movie make me wanna do some experimental in the flash. If you don’t want to be spoiled please skip the next bit that I’m gonna write next. And if you read here that mean you don’t care the spoiled, well the scene that the alien flies try to get in the mirror. The animation is quite cool and I think that is some kind of old trick animation by “Brownian” equation so I’ve done some experimental below:

Simple Brownian Movement:

Simple Brownian

Adapted version, try to make its come out closer to the film:

Brownian 2
(Click anywhere on the stage to restart the animation)

Useful HexColor Extract Code

This code help me solve many cool effect and also shorten my writing. Also sometime it is easily to forget so here is another good tips to note on here 🙂

var colour:uint = 0xFF297400;
var A:Number = colour >> 24 & 0xFF;
var R:Number = colour >> 16 & 0xFF;
var G:Number = colour >> 8 & 0xFF;
var B:Number = colour & 0xFF;

// RGB
var colourRBG:uint = (R << 16 | G << 8 | B);

// ARGB
var colourARBG:uint = (A << 24 | R << 16 | G << 8 | B);

Radians & Degrees

This math always come back to me after a certain of time and take me 5 – 10 minutes to think or look around the correct one. So I write this down for myself and others for save time to look around.

radians = degrees * Math.PI / 180
degrees = radians * 180 / Math.PI

P.S.
360 degrees = 2 * Math.PI (radian)

BenchMark with leaves version 2

After have some fun with the first version then I’ve update some math and fine tune some attributes to allow more leaf to be able to render. Next version expect to do something more random and closer to nature.

Benchmark 2

This version can increase the number of leaf to 60 and able to decrease down to 10. But sorry for auto repeat for increase and decrease button. I’ll add in next version if the next version is happen.

BenchMark with leaves.

This experimental in the night is so fun but right now I’m feeling so sleepy, gotta go sleep and will play more with this one later.

Benchmark Version1

The spiral shape is scaling by using “Fibonacci” number and all animation use TweenMax.