Saturday, May 29, 2010

I've been playing with curves...



Specifically, I've been playing with how to animate curves and keep them random but smooth. This here's my second version. The original is below. A little less trippy...or at least a different trippy.

OH, by the way. Click the above to change the color of the glow. Some glows are more powerful than others, so if you don't see much of a glow...click!



The bulk of this is done by connecting an array of points with Flash's curveTo function and then then slightly changing the curve values every frame. The top was made with a BitmapData field over the top to give that glow effect (see 2 posts ago). As for the non-glowing version, I simply told the curves to fill in with a color. Since the points are intersecting all sorts of wobbly angles, you'll have some "negative" areas that won't be filled in, generating a nifty little checkerboard effect.

UPDATE: Looking at this little project the day after the fact reminds me why I love doing this so much. I put a VERY slight offset in the curve points that are randomized. The curves work wonderfully to show how a small change can have a large impact. If the initial offset was too large, you'd see the curves jitter as they scramble to their new random point. With no offset, the curves would essentially loop indefinitely in the same pattern (I'm using sin to loop). This tiny tiny offset adds upon itself, so once through the sin period, it has altered ever so slightly. Given that there are....I think 50? points on each glob of curves, that winds making a whole new pattern EVERY time it cycles through! The odds of getting the same exact curve are next to nothing! Add to that the fact that there are really 3 individual continuous curve globs and you really won't see the same thing twice...fun!

Friday, May 28, 2010

Perlin Noise



Okay, so messing about with BitmapData inevitably led to learning about Perlin Noise. Named for Ken Perlin, a VFX fellow, it is used to procedurally generate textures in an organic way. I'm still trying to wrap my head around how exactly to use it, but the above is my first baby step into transforming a Perlin field...next step is to apply that field to something else!

Thursday, May 27, 2010

Sparklies!



No large version.

Okay, so thanks to this, I feel I've gained a little knowledge in the world of the BitmapData class in Flash. And good god...if you want some absolutely stunning effects, learn more about it! What we've got here is essentially a Bitmap (literally a...map of bits...) that is showing off its pixel data (naughty!). Since this data is now available to us, we can manipulate it however we'd like. In this case, we're putting a little glow and blur filters on it. HOWEVER...the Bitmap that we've drawn on the stage is a solid rectangle. So why does that glow appear inside this rectangle?

Enter the "draw" method of the BitmapData. See those little flickery particles? Those act as "holes" in the BitmapData. Every frame, Flash is redrawing that initial rectangle and taking a peek at what it looks like. If we have one of our particles over the rectangle, that rectangle isn't visible where the particle exists. So, as far as Flash is concerned there's nothing there. So we get a hole...a hole that can have a blur and glow filter applied to it! Nifty!

Tuesday, May 25, 2010

It's almost like a fortune cookie...



Large version - highly recommended.

Whee! Twitter API AWAY! I've spent a little while now trying to get an understanding of the Twitter API and integrating it with Flash. Turns out there are some nice resources out there on how to get it running, but the thing that gave me the most difficulty was learning how to deal with the incoming data (which is in the form of an Atom feed with the Search API).

So...enjoy!