PDA

Click to See Complete Forum and Search --> : Fractal Trees



premasagar
07-04-2002, 06:57 PM
Has anyone created code (or know where there is some) for a simple fractal tree?
I'm not a mathmatician or physicist, but can grasp the basics. I was trying to do this by starting with a movieclip containing a rectangle for the trunk, then repeatedly duplicating the clip, rotating it and scaling it down, but I ran into problems with getting the positioning right.

Keith Peters (if you are there), I saw a couple of simple fractal line trees of yours that would set me on the right path.

Thanks a lot to any and all,
Prem.

premasagar
07-05-2002, 09:34 AM
So let's see...
I've discarded my chunky movieclips and tried to simplify the matter. Please tell me what I am doing wrong here:

SWF:
http://www.angelfire.com/sk/monkeypuzzle/flash/newexpt5.swf
FLA:
http://www.angelfire.com/sk/monkeypuzzle/flash/newexpt5.fla

The setup
=========
There is an instance of the movieclip "line" on the stage at the start. This is just a vertical line. Then the actionscript:

_root:
------
branches=1;
count=0;

"line" movieclip:
-----------------
if (_root.count<=_root.branches) {
this.attachMovie("line", "line1", 1);
line1._yscale = 50;
line1._rotation = -45;
this.attachMovie("line", "line2", 2);
line2._yscale = 50;
line2._rotation = 45;
}
_root.count += 1;

Thank you!!!
Prem.

BlinkOk
07-16-2002, 04:53 AM
http://www.were-here.com/forums/showthread.php?s=f69543f98d1c56c15d9b2a500e8674a8&threadid=136609