Author Archives: Zevan

Recursive 2D Structure

CLICK HERE TO COPY
Actionscript:

[SWF(width = 600, height = 700, frameRate=24)]

var canvas:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);

addChild(new Bitmap(canvas));

 

var maxBranches:int = 600;

var branches:int = 0;

var startX:Number = 300

makeBranch(startX,690,30,-60, 60);

 

function makeBranch(xp:Number, yp:Number, step:Number, min:Number, max:Number):void {

    var vectors:Shape = Shape(addChild(new Shape()));

    var cX:Number, cY:Number, eX:Number, eY:Number

    var dcX:Number=xp, dcY:Number=yp, deX:Number=xp, deY:Number=yp;

    var theta:Number = (min [...]

Posted in BitmapData, bezier, functions, misc, motion | Tagged , , | 7 Comments

Smudge Tool #1

CLICK HERE TO COPY
Actionscript:

[SWF(backgroundColor = 0xCCCCCC)]

var canvas:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true, 0xFFFFFFFF);

addChild(new Bitmap(canvas));

 

var loader:Loader = new Loader();

loader.load(new URLRequest("http://actionsnippet.com/wp-content/chair.jpg"));

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onComplete(evt:Event):void{

    canvas.draw(loader);

}

 

var brush:Shape = new Shape();

var diameter:Number = 120;

var radius:Number = diameter / 2;

var matrix:Matrix = new Matrix();

 

var brushAlpha:BitmapData = new BitmapData(diameter, diameter, true, 0x00000000);

drawRadial();

brushAlpha.draw(brush);

 

var xp:Number = 0, yp:Number = 0, px:Number = 0, py:Number = [...]

Posted in BitmapData | Tagged , , | 1 Comment

Isometric Cones (spikes)

CLICK HERE TO COPY
Actionscript:

[SWF(width = 600, height = 500, backgroundColor=0xFFFFFF)]

 

var canvas:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);

addChild(new Bitmap(canvas));

 

var matrix:Matrix = new Matrix();

var grid:Sprite =   new Sprite();

grid.filters = [new DropShadowFilter(4, 0, 0, 0.05, 20, 10)];

matrix.rotate(Math.PI / 4);

matrix.scale(1, 0.6);

matrix.translate(stage.stageWidth / 2, stage.stageHeight / 2 + 50);

grid.transform.matrix = matrix;

 

var rowCol:int = 9;

var spikeNum:Number = rowCol * rowCol;

var diameter:Number = [...]

Posted in 3D, BitmapData, misc | Tagged , , | Leave a comment

Isometric Transformation Matrix

CLICK HERE TO COPY
Actionscript:

var grid:Sprite = Sprite(addChild(new Sprite()));

var matrix:Matrix = new Matrix();

// make the grid sprite look isometric using the transform.matrix property

matrix.rotate(Math.PI / 4);

matrix.scale(1, 0.5);

matrix.translate(stage.stageWidth / 2, stage.stageHeight / 2);

grid.transform.matrix = matrix;

 

// draw a grid of circles to show that it does in fact look isometric

var rowCol:Number = 8;

var num:Number = rowCol * rowCol;

 

var diameter:Number [...]

Posted in DisplayObject, misc | 3 Comments