-
Notifications
You must be signed in to change notification settings - Fork 2
/
AFrameCurveComponent.html
24 lines (22 loc) · 1013 Bytes
/
AFrameCurveComponent.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AFrame Curve Component</title>
<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script> <script src="https://unpkg.com/aframe-curve-component/dist/aframe-curve-component.min.js"></script>
</head>
<body>
<a-scene>
<a-curve id="track1">
<a-curve-point position="-1 1 -3"></a-curve-point>
<a-curve-point position="1 1 -3"></a-curve-point>
</a-curve>
<!-- Draw the Curve -->
<a-draw-curve curveref="#track1" material="shader: line; color: blue;"></a-draw-curve>
<!-- Clone a Box along the Curve -->
<a-entity clone-along-curve="curve: #track1; spacing: 0.2; scale: 1 1 1; rotation: 0 0 0;" geometry="primitive:box; height:0.1; width:0.2; depth:0.1"></a-entity>
</a-scene>
</body>
</html>