CLICK HERE TO COPY
Actionscript:
[SWF(width = 500, height=500, backgroundColor = 0x000000)]
x = stage.stageWidth / 2;
y = stage.stageHeight / 2;
// standard Vectors for using drawTriangles and projectVectors
var verts:Vector.<Number> = new Vector.<Number>();
var pVerts:Vector.<Number>;
var uvts:Vector.<Number>;
var indices:Vector.<int>;
// needed for z-sorting
var sortedIndices:Vector.<int>;
var faces:Array = [];
// we'll use this for transforming points
// and as the transformation matrix for our render
var m:Matrix3D = [...]