I’m a bit late on this one, but here it is…
So I managed to port my NodeDraw thingie into only 20 lines of code! I’ll probably post more than one version, the next maybe being an interactive one
It’s using BitmapData to speed up the process so don’t expect any details if you zoom in
I excluded the arrays so it won’t lag kirupa and/or make a long page, the arrays will be in the attachment txt, they should be on line 1 and 2
[COLOR=Red]**
WARNING:**[/COLOR] Very CPU intensive, it goes to the top while it’s drawing. I made it
a bit progressive so it doesn’t freeze and you can cancel (close) it at any time. You have been warned!
var bitmap:flash.display.BitmapData = new flash.display.BitmapData(800, 600, true, 0x000000);
var b:MovieClip = _root.createEmptyMovieClip("b", _root.getNextHighestDepth());
var c:MovieClip = _root.createEmptyMovieClip("c", _root.getNextHighestDepth());
var l:MovieClip = c.createEmptyMovieClip("l", c.getNextHighestDepth());
b.attachBitmap(bitmap, b.getNextHighestDepth());
var i = 0;
drawInt = setInterval(drawOne, 1);
function drawOne() {
for (var n = i+1; n<px.length; n++) {
var dist = Math.sqrt(Math.pow(px*-px[n], 2)+Math.pow(py*-py[n], 2));
if (dist<100) {
c.l.clear();
c.l.lineStyle(1, (i+n)/2*0xFFFFFF/px.length, 50-dist);
c.l.moveTo(px*, py*);
c.l.lineTo(px[n], py[n]);
bitmap.draw(c);
}
}
i++;
if (i>px.length) {
clearInterval(drawInt);
}
}