UNPKG

aframe-lsystem-component

Version:

L-System/LSystem component for A-Frame to draw 3D turtle graphics. Using Lindenmayer as backend.

43 lines (33 loc) 1.72 kB
<html> <head> <title>Testing experimental things</title> <script src="../libs/aframe.js"></script> <script src="../libs/aframe-lsystem-component.js"></script> <style media="screen"> body { background-color: #94bfcf; } </style> </head> <body> <a-scene> <a-assets> <a-mixin id="yellow" material="color: yellow;"></a-mixin> <a-mixin id="green" material="color: #528e1e;"></a-mixin> <a-mixin id="red" material="color: #8e311e;"></a-mixin> <a-mixin id="line" geometry="primitive: box; height: 0.2; width: 0.1; depth: 0.1;" material="metalness:0.2"></a-mixin> </a-assets> <!-- context sensitive L-System --> <!-- color index and size change --> <!-- <a-entity position="0 -1 -3" lsystem="axiom: A; productions: A:A+AA; segmentMixins: A:green line,red line; iterations: 3; angle: 45"> </a-entity> --> <!-- <a-entity id="kochflake" lsystem="axiom: A>>B>>A; productions: A:A-A++A-A B:B-B++B-B; segmentMixins: A:red line,green lineB:yellow line; angle: 60; iterations: 2" rotation="0 45 0" position="0 2 -5"> </a-entity> --> <!-- <a-entity id="colortest" lsystem="axiom: A!A!A''BB!B; productions: A:A; segmentMixins: A:red line,green line,yellow lineB:yellow line,green line; angle: 60; iterations: 0" rotation="0 45 0" position="0 2 -5"> </a-entity> --> <a-entity id="colortest" lsystem="axiom: A!A!A''BB!B; productions: A:A; segmentMixins: A:red line,green line, yellow line B:yellow line,green line; angle: 60; iterations: 0" rotation="0 45 0" position="0 2 -5"> </a-entity> </a-scene> </body> </html>