forked from stemkoski/A-Frame-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parametric-path-follow.html
49 lines (38 loc) · 1.25 KB
/
parametric-path-follow.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title>A-Frame - Parameterized Path Following</title>
<script src="js/aframe-master-v1.3.0.min.js"></script>
<script src="js/aframe-environment-component.min.js"></script>
<script src="js/extended-wasd-controls.js"></script>
<script src="js/parser.js"></script>
<script src="js/aframe-parametric-curve.js"></script>
<script src="js/aframe-tube-geometry.js"></script>
<script src="js/aframe-curve-follow.js"></script>
</head>
<body>
<a-scene environment="preset: default; fog: 0;" keyboard-shortcuts="enterVR: false;">
<a-assets>
<a-asset-item id="jet" src="models/jet/Jet.gltf"></a-asset-item>
</a-assets>
<a-entity camera wasd-controls look-controls position="0 3 0"></a-entity>
<a-entity id="path"
parametric-curve="xyzFunctions: 2*cos(t), 0.5*cos(3*t) + 2, 2*sin(t);
tRange: 0, 6.283;">
</a-entity>
<a-entity position="0 0 -4">
<a-entity
tube-geometry="curveData: #path; type: parametric-curve;
tubeSegments: 200; radius: 0.02; tubeColor: yellow;">
</a-entity>
<a-entity
id="jetModel"
scale="0.1 0.1 0.1"
gltf-model="#jet"
curve-follow="curveData: #path; type: parametric-curve;
duration: 4; loop: true;">
</a-entity>
</a-entity>
</a-scene>
</body>
</html>