Modulo madness!

Actionscript, Flash, Flex Add comments

Last word on Modulo I promise!

I found another great use for Modulo. While dynamically incrementing a rotation property your values can get a bit out of control as your object spins wildly out of control (think Papervision here). Using Modulo you can make sure your rogue object sticks to the 360 degrees that it’s supposed to be spinning through!

myCube.rotationX = (myCube.rotationX+=10)%360;

Ok, that’s it with Modulo now … unless someone can impress me with another amazing use for it.

Digg!

Leave a Reply

 
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in