aframe-lsystem-component
Version:
L-System/LSystem component for A-Frame to draw 3D turtle graphics. Using Lindenmayer as backend.
50 lines (39 loc) • 1.39 kB
HTML
<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="lightgreen" material="color: #6eb82f;"></a-mixin>
<a-mixin id="verylightgreen" material="color: #c2f597;"></a-mixin>
<a-mixin id="red" material="color: #b32d12;"></a-mixin>
<a-mixin id="line" geometry="primitive: box; height: 1; width: 0.5; depth: 0.5;"></a-mixin>
<a-mixin id="sphere" geometry="primitive: sphere; radius: 0.5"></a-mixin>
<a-mixin id="ring" geometry="primitive: ring; radiusInner: 0.5; radiusOuter: 1"
material="side: double"></a-mixin>
</a-assets>
<a-entity id="multi" lsystem="
axiom: AB;
productions:
A:CCCA
B:DDDB;
segmentMixins:
A: yellow line
B: yellow sphere
C: lightgreen line
D: red sphere;
iterations: 1;" rotation="0 45 0" position="0 2 -5">
</a-entity>
</a-scene>
</body>
</html>