Archive for the 'actionscript' Category

Texture Archive

Saturday, October 18th, 2008

When flash 8 first came out I spent a week or two playing with BitmapData and writing some AS1 style libraries… doing things like photoshop style polar coordinates filters, brightness/contrast and distortable vector shapes that I would use as brushes. Finally got around to re-uploading these after changing servers… so here they are:

Click any of the below images to view the entire texture archive

Video Feedback Texture

Friday, October 17th, 2008

Taking a bitmap, transforming it in some way and copying it back to itself can sometimes produce things that look like video feedback - coupled with blendmodes you can get some unexpected and interesting effects.

Continue reading this post to see flash version…

Read the rest of this entry »

Polar Coordinates, Sine, Cosine…

Monday, October 13th, 2008

One of my many favorite equations is the conversion from polar coordinates to cartesian... in actionscript it looks like this:

Actionscript:
  1. x = radius * Math.cos(theta);
  2. y = radius * Math.sin(theta);

I was teaching the ins and outs of polar coordinates to my students yesterday and thought of a good assignment for them... "Use Graphics or BitmapData to create an interactive sketch involving the polar to cartesian conversion." Now, when I first encounted this equation, I didn't really know what it was or why it worked... I used it for circular motion in Director... I also tried randomly tweaking it to see what kind of results I could get.... things like this:

Actionscript:
  1. // sort of like a figure 8
  2. x = radius * Math.cos(theta);
  3. y = radius * Math.sin(theta/2);
  4.  
  5. // an oval
  6. x = radius/2 * Math.cos(theta);
  7. y = radius * Math.sin(theta);
  8.  
  9. // etc...
  10. x = radius * Math.cos(theta);
  11. y = radius * Math.sin(theta) + radius * Math.cos(theta * 2);

I advocate this kind of random experimentation when I teach game design or talk to students interested in generative visuals. Playing with the numbers just improves understanding... even if you don't know what your playing with at first...

When I got home yesterday I created this small sketch:


To see the flash version continue reading this post....

Read the rest of this entry »