Tag Archives: actionscript

QuickBox2D Editor 2B Released

I’ll be releasing the QuickBox2D on googlecode in the near future based on the response to yesterdays post.

Posted in QuickBox2D | Also tagged , , , | 16 Comments

AS Quiz #18

Today’s quiz is about BitmapData and the Graphics class…

Number of Questions : 5
Difficulty : Medium
Topic : BitmapData, Graphics

True or False. Subpixel x and y coordinates for DisplayObjects are made possible by anti-aliasing.



Which of the following methods would you use to set a pixel with an alpha channel value?





Which of the following methods would you used if you wanted to boost performance when drawing to a BitmapData object?




True or False. Perlin Noise is built right into the BitmapData class.



Which of the following methods does not exist in the Graphics class?











Posted in Quiz | Also tagged , , | 8 Comments

Logistic Map Play

Actionscript:
  1. var offX:Number = 100;
  2. var offY:Number = 300;
  3. var scalarX:Number = 6;
  4. var scalarY:Number = 200;
  5. addEventListener(Event.ENTER_FRAME, onLoop);
  6. function onLoop(evt:Event):void{
  7.     var r:Number = mouseY / 100;
  8.     var xn:Number = (mouseX - 100) / 650;
  9.     var xn1:Number = 0;
  10.     graphics.clear();
  11.     graphics.lineStyle(0,0);
  12.     for (var i:int = 0; i<100; i++){
  13.       xn1 = r * xn * (1 - xn);
  14.       xn = xn1;
  15.       if (i == 0){
  16.         graphics.moveTo(offX+i*scalarX,offY+xn1*scalarY);  
  17.       }else{
  18.         graphics.lineTo(offX+i*scalarX, offY+xn1*scalarY);
  19.       }
  20.     }
  21. }

Whenever I can't decide what kind of snippet to make, I simply go to wikipedia or mathworld for a bit and I always end up with something. I've messed with Logistic Maps before (when learning about strange attractors). This is a simple rendering where the x and y axis change the biotic potential (r) and the starting value for x.

Here is the link I used for reference.


Have a look at the swf (just move your mouse around).

Posted in Graphics, Math, misc | Also tagged , | 2 Comments

Color Words Motion Capture

We're still working on this long term project for medialab prado in madrid. Here is a camera test from today. It uses frame differencing and places names of colors on the areas of motion.


Click here to view the swf file... make sure to move around a bit in front of your web-cam.

Posted in Announcements, misc | Also tagged , , | 2 Comments