My first node-garden

http://www.avalon-rev.dk/junk/nodes/nodegarden.html

pretty basic so far… can’t wait to dive deeper into this =)

Just refresh the page for a new “garden”.

(remember it takes a while to create the lot… :sure:

it takes about 3 seconds on my com at work (where I am now)…

hm… maybe I’ll try making this in 3d!!

That’s nice. I think I wrote something like this in C a year ago, only it was to make a tree. You had a straight line for the trunk, then it was just a random thing for the branches, like it could have either two, one or no brnches, and each of those could have two, one or no branches from that… It was really cool watching it draw it on screen.

And we played around with it a bit, and made bonsai C trees. :slight_smile:

hiccup

oh my gosh! That’s so cool! awesome maan!

hm… I may do a tut… if I can ever get my lazy arse out of the seat and DO it… :-\

if ppl even want to see a tut on this…

Hey eilsoe,
The animation looks great! I’m sure people would be interested in seeing a tutorial on this - I know I am hehe.

Cheers!
Kirupa :ub:

awsome work!
really cool

(1.5 seconds here)

Creatures

It took no time at all here - great work man! It looks great!

for those who want’s to study it independently, use this:

[AS]
total=70;
maxdist=100;
createlines=function(){
nodearray=[];
for(i=0;i<=total;i++){
node=attachMovie(“node”,“newnode”+i,i);
nodearray*=node;
node._x=random(550);
node._y=random(400);
}
for(a=0;a<nodearray.length;a++){
firstnode=nodearray[a];
for(b=0;b<nodearray.length;b++){
secondnode=nodearray[ b];
dx=firstnode._x-secondnode._x;
dy=firstnode._y-secondnode._y;
dist=Math.sqrt((dxdx)+(dydy));
if(dist<maxdist){
c++;
_root.createEmptyMovieClip(“line”+c,c+total);
newlines=this[“line”+c];
newlines.lineStyle(0,0xFFFFFF,(100-dist));
newlines.moveTo(firstnode._x,firstnode._y);
newlines.lineTo(secondnode._x,secondnode._y);
}
}
}
}
createlines();
[/AS]

Just make a MC of the node you wanna use, and set the linkage to actionscript in the prop panel, use the link name “node”.

the code goes in the first frame of the main timeline…

You know what - looking at that like is trying to read chineese.

I am just going to take your word for it dude. :wink:

I’ll make a tut sooner or later :slight_smile:

doesn’t bit-101 already have a tutorial on this?

Wow, node gardens are fun to play with!!!

Here is what I came up with…

Here is my code…
[AS]numNodes = 25;
nodez = [];
MovieClip.prototype.ranMove = function() {
this._x += (this.newX-this._x)/this.speed;
this._y += (this.newY-this._y)/this.speed;
if (Math.round(this._y) == Math.round(this.newY) && Math.round(this._x) == Math.round(this.newX)) {
this.newX = Math.round(Math.random()550);
this.newY = Math.round(Math.random()400);
this.speed = Math.ceil(Math.random()
(10-2)+2);
}
};
for (i=0; i<numNodes; i++) {
node = attachMovie(“node”, “n”+i, i);
nodez
= node;
node._xscale = node._yscale=Math.random()100+50;
node.onEnterFrame = ranMove;
}
minDist = 120;
_root.onEnterFrame = function() {
var i, j, nodeA, nodeB, dx, dy, dist, alpha;
clear();
for (i=0; i<nodez.length-1; i++) {
nodeA = nodez
;
for (j=i+1; j<nodez.length; j++) {
nodeB = nodez[j];
dx = nodeB._x-nodeA._x;
dy = nodeB._y-nodeA._y;
dist = Math.sqrt(dxdx+dydy);
if (dist<minDist) {
alpha = 100-dist/minDist*100;
lineStyle(1, 0xffffff, alpha);
moveTo(nodeA._x, nodeA._y);
lineTo(nodeB._x, nodeB._y);
}
}
}
};[/AS]

Nodes are like the coolest flash thing ever
as soon as I’m done learning AS that’s what I want to expirement with, they are both visually and mathematically appealing.

A tut would definately be awesome!

*Originally posted by lostinbeta *
**Wow, node gardens are fun to play with!!!

Here is what I came up with…

http://www.lostinbeta.com/experimental/nodeGarden.html

Here is my code… **

hey it looks awsome can u explain me the code? =/ perhaps?

Creatures