eilsoe
March 13, 2003, 12:42pm
1
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!!
system
March 13, 2003, 12:52pm
2
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.
system
March 13, 2003, 1:26pm
4
oh my gosh! That’s so cool! awesome maan!
system
March 13, 2003, 1:30pm
5
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…
system
March 13, 2003, 1:58pm
6
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:
system
March 13, 2003, 3:58pm
8
It took no time at all here - great work man! It looks great!
system
March 13, 2003, 5:25pm
9
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)+(dy dy));
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…
system
March 13, 2003, 5:48pm
10
You know what - looking at that like is trying to read chineese.
I am just going to take your word for it dude.
system
March 13, 2003, 5:57pm
11
I’ll make a tut sooner or later
system
March 13, 2003, 6:04pm
12
doesn’t bit-101 already have a tutorial on this?
system
March 13, 2003, 8:17pm
13
Wow, node gardens are fun to play with!!!
Here is what I came up with…
Get your own corner of the Web for less! Register a new .COM for just $9.99 for the first year and get everything you need to make your mark online — website builder, hosting, email, and more.
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+dy dy);
if (dist<minDist) {
alpha = 100-dist/minDist*100;
lineStyle(1, 0xffffff, alpha);
moveTo(nodeA._x, nodeA._y);
lineTo(nodeB._x, nodeB._y);
}
}
}
};[/AS]
system
March 13, 2003, 8:24pm
14
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!
system
March 13, 2003, 9:01pm
15
*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