diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2012-05-18 11:11:50 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2012-05-18 11:11:50 +0300 |
| commit | 7d8c903ff7800d25108930c2ea4e64a62f1cd03f (patch) | |
| tree | 7e48e52810850d5083b8b3b53a810966711e1a22 /README.md | |
| parent | c900d290a3d86a4486ac2a8790de0b89b914c47d (diff) | |
syntax and usage in README
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -2,3 +2,22 @@ L-Systems.JS ============ A full, 3D L-Systems implementation in JavaScript + +Syntax +------ + + - `F`: move one unit vector forward + - `+` / `-`: turn right / left by angle `alpha` + - `&` / `^`: pitch up / down by angle `alpha` + - `<` / `>`: roll right / left by angle `alpha` + - `|`: reverse vector direction + - `[` / `]`: push / pop current tree state + +Usage +----- + +```js +var lsys = new LSystem('F', { 'F' : 'F-F+FF' }); +var tree = lsys.iterate(2); +console.log(tree) // F-F+FF-F-F+FF+F-F+FFF-F+FF +``` |
