This is an ambigram by Scott Kim, vectorized by Miles Steele, cleaned up by Dan Lewis, and put inside an OpenLaszlo application. (If you don’t see it, click here.)
Ambimation 2
Posted by Oliver
on May 01, 2008
Trackbacks
Trackbacks are closed.
Isn’t Scott Kim one of the people interviewed in Programmers at Work? Cool.
Mind giving a few details on how you implemented this?
Thanks! It’s an OpenLaszlo application; the core looks like this:
[code language="xml"]
[/code]
classdefines a view that’s scaled to the canvas size and that embeds a Flash movie of the image. The three levels of view hierarchy are because ‘rotation’ is relative to the origin (the upper left corner); thex@ and @yoninnerplace the center of the image at the origin of the rotor, and thex@ and @yonouterplace the origin of the rotor at the center of the canvas. With matrices you rotate around a point by sandwiching the rotation between a translation and its inverse; instead I represent each transformation as a view and let the rendering engine do this, so that I can animate therotationattribute and let the animation system handle the rest.To get the shadow, move the
x@ and @yfrominnerto the definition ofoflipin the code above, and then make two more copies ofoflipright aboverotor. An interval timer copies the rotations frominner->s1@ -> @s2on each frame.[code language="xml"]
[/code]
Mouse tracking uses
Math.atan2and the mouse position relative toouter. Motion blur animates the blur effect’s blur radius up to 4 when the image is spinning and back down to 0 when it stops. Both of these piggy-back on the same interval timer that makes the shadow. I tried to turn off the effects when the frame rate got slow, but I don’t think this worked, and I ran out of time.