Author Archives: Zevan

BitmapData Static

CLICK HERE TO COPY
Actionscript:

var canvas:BitmapData = new BitmapData(500,500,false, 0x000000);

addChild(new Bitmap(canvas));

 

var pix:Vector.<uint> = new Vector.<uint>(canvas.width * canvas.height, true);

 

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {

    canvas.lock();

    var i:int = pix.length;

    while(--i> -1){

        var c:uint = uint(Math.random() * 255);

        pix[i] = c <<16 | c <<8 | c;

    }

    canvas.setVector(canvas.rect, [...]

Posted in BitmapData, Vector, misc | Tagged , , | 6 Comments

Gradient Bezier 3D

CLICK HERE TO COPY
Actionscript:

[SWF(backgroundColor=0x333333, width=800, height=600)];

x = stage.stageWidth / 2;

y = stage.stageHeight / 2;

var verts:Vector.<Number>  = new Vector.<Number>();

var tVerts:Vector.<Number> = new Vector.<Number>();

var pVerts:Vector.<Number> = new Vector.<Number>();

var uvts:Vector.<Number> = new Vector.<Number>();

 

var igraph:Vector.<IGraphicsData> = new Vector.<IGraphicsData>();

 

var tVect:Vector3D = new Vector3D();

var m:Matrix3D = new Matrix3D();

for (var i:int = 0; i<200; i++){

    for (var j:int = 0; j<3; [...]

Posted in 3D, Graphics, bezier | Tagged , , | Leave a comment

3D Bezier

CLICK HERE TO COPY
Actionscript:

[SWF(backgroundColor=0x000000, width=800, height=600)];

x = stage.stageWidth / 2;

y = stage.stageHeight / 2;

var verts:Vector.<Number>  = new Vector.<Number>();

var tVerts:Vector.<Number> = new Vector.<Number>();

var pVerts:Vector.<Number> = new Vector.<Number>();

var uvts:Vector.<Number> = new Vector.<Number>();

 

var igraph:Vector.<IGraphicsData> = new Vector.<IGraphicsData>();

 

var tVect:Vector3D = new Vector3D();

var m:Matrix3D = new Matrix3D();

for (var i:int = 0; i<300; i++){

    for (var j:int = 0; j<3; [...]

Posted in 3D, Graphics, bezier | Tagged , , , | 3 Comments

Sierpiński Glitch Texture #3

CLICK HERE TO COPY
Actionscript:

[SWF(frameRate=60, backgroundColor=0x000000, width=500, height=500)]

 

var canvas:BitmapData = new BitmapData(500,500,false, 0x000000);

addChild(new Bitmap(canvas));

var clone:BitmapData = new BitmapData(500,500,false, 0x000000);

var canvasRect:Rectangle = canvas.rect;

var w:int = canvas.width;

var w2:Number = 1/w;

var w10:Number = 1/(w * 80);

var convert:Number = Math.PI/180;

var size:int = canvas.width * canvas.height;

var pix:Vector.<uint> = new Vector.<uint>(size, true);

var m:Matrix = new Matrix();

m.scale(1,-1);

m.translate(0,canvas.height);

var sin:Number = 0, cos:Number = 0;

var [...]

Posted in BitmapData, Operators, Vector, pixel manipulation | Tagged , , | 2 Comments