summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2012-05-21 13:45:44 +0300
committerYuval Adam <yuv.adm@gmail.com>2012-05-21 13:45:44 +0300
commit18f7619fdb60e7e88daf28dcd203a6d089e54d27 (patch)
treef5bbd21e4bebef664bd359d91615ad9ecc488ff6
parent029f1aa1d0b18f761268c823971053af68064f8c (diff)
update homepage with API changes
-rw-r--r--index.html7
1 files changed, 3 insertions, 4 deletions
diff --git a/index.html b/index.html
index 453cf97..349d2b3 100644
--- a/index.html
+++ b/index.html
@@ -54,8 +54,8 @@
<div class="span12">
<p>The canonical usage would be to create the L-System itself by defining the axiom string and the production rules, running the iteration, and generating the respective cartesian coordinates.</p>
<pre class="prettyprint">
-var lsys = new LSystem('F', { 'F': 'F-F+FF' });
-var tree = lsys.iterate(2);
+var lsys = new LSystem('F', { 'F': 'F-F+FF' }).iterate(2);
+var tree = lsys.print();
console.log(tree); // F-F+FF-F-F+FF+F-F+FFF-F+FF
var coords = lsys.draw(Math.PI / 2);
console.log(coords); // [[[0,0,0], [0,1,0], [1,1,0], ... ]]</pre>
@@ -112,8 +112,7 @@ for (var i=0; i&lt;coords.length; i++) {
init();
draw_axes();
- var lsys = new LSystem('F', { 'F': 'F+F-F-F+F' });
- var tree = lsys.iterate(3);
+ var lsys = new LSystem('F', { 'F': 'F+F-F-F+F' }).iterate(3);
var coords = lsys.draw(Math.PI / 2);
draw_lsys(coords);
animate();