Author Archives: Zevan

Implicit 3D Plot

CLICK HERE TO COPY
Actionscript:

var matrix:Matrix3D = new Matrix3D();

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

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

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

for (var i:Number = -2; i<2; i+=.04) {

    for (var j:Number = -2; j<2; j+=.04) {

        for (var k:Number = -2; k<2; k+=.04) {

            // blobby, from [...]

Posted in 3D, BitmapData, Math, Vector, graphics algorithms, pixel manipulation, strings | Tagged , | Leave a comment

static BitmapData References

CLICK HERE TO COPY
Actionscript:

package{

   

    import flash.display.*;

    import flash.events.*;

    import flash.geom.*;

   

    public class QuickCheckBox extends Sprite{

       

        private var _checked:Boolean;

        private var _bitmap:Bitmap;

        private var _canvas:BitmapData;

       

        private static var [...]

Posted in BitmapData, OOP, UI | Tagged , | 4 Comments

Loop Through All Properties of a Class

CLICK HERE TO COPY
Actionscript:

package {

   

    import flash.display.Sprite;

    import flash.utils.describeType;

   

    public class Main extends Sprite {

       

        public function Main(){

            var test:Test = new Test();

            var desc:XML= describeType(test);

            [...]

Posted in OOP, Object, XML, dynamic | Tagged , | 3 Comments

Point in Polygon

CLICK HERE TO COPY
Actionscript:

// function found here:

// http://www.alienryderflex.com/polygon/

function pointInPolygon(x:Number, y:Number, polyX:Array, polyY:Array):Boolean{

    var j:int = polyX.length - 1;

    var oddNodes:Boolean = false;

    for (var i:int=0; i <polyX.length; i++) {

    if (polyY[i] <y && polyY[j]>= y ||  polyY[j] <y && polyY[i]>= y) {

 

      if (polyX[i] + (y - polyY[i]) / [...]

Posted in graphics algorithms, misc | Tagged , | 2 Comments