Get Sources of Tree Biomorph Toy AS
Lindenmayer Systems very powerful tool for make organic structures. My example make with Andy Zupko L-system class, for make separate branches, and add TweenLite for animating each line. I take two Turtle rules from Artificial Life by Scott Cameron.Get Sources Of Animate L-system
25.04.2008. 13:48
Hi,
great work! I tried to re-use the plant class in a simple papervision basicview like this
p= new Plant(100,3);
p.draw(0,0,0)
..
it complies okay but i cant see anything at all. What am i doing wrong?
Thanks! First, you need to setup LSystem:
var commands:String = "X:F-[[&X]++!F-X]nF:FF";
var LSys:LSystem = new LSystem(22.5, 5, "X");
LSys.ratio = 0.94;
LSys.branchGrowingTime = 0.01;
LSys.size = 1;
var ar:Array = commands.split("r");
for (var i:int = 0; i < ar.length; i++)
LSys.rules.push(Rule.createRule(ar[i]));
var marker:Displayobject3D = new Displayobject3D();
marker.pitch(270);
LSys.DrawSystem(LSys.GetCommand(), 0 , marker, 1000000, 100);
and after that you can add plant:
p = new Plant( LSys );
p.growTrunkBranch(0); // start Growing
scene.addChild(p);
U can check my implementation on my site!
Write a comment
* = required field