-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgunscene.html
More file actions
88 lines (63 loc) · 4.08 KB
/
gunscene.html
File metadata and controls
88 lines (63 loc) · 4.08 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<!-- This Demo overlays a rigged hand on top of the existing page. Requires a WebGL-capable browser. -->
<head>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script>
<script src="src/inflate.min.js"></script>
<!-- <script src="src/require.js"></script> -->
<script src="node_modules/leapjs/leap-0.6.4.min.js"></script>
<script src="node_modules/leapjs-plugins/main/leap-plugins-0.1.12.min.js"></script>
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<script src="node_modules/aframe-extras/dist/aframe-extras.min.js"></script>
<!-- <script src="node_modules/aframe-alongpath-" -->
<!-- <script src="node_modules/aframe-leap-hands/dist/aframe-leap-hands.min.js"></script> -->
<script src="src/main.js"></script>
<script src="src/leap.rigged-hand-0.1.7.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.2.0/dist/aframe-physics-system.min.js"></script>
<script src="node_modules/aframe-template-component/dist/aframe-template-component.min.js"></script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<!-- START CODE -->
<a-scene leap="vr: false" id="gun-scene" antialias="true" embedded>
<div class="a-enter-vr"></div>
<a-assets>
<img id="floor" src="https://cdn.aframe.io/a-painter/images/floor.jpg" crossOrigin="anonymous">
<img id="skymap" src="https://cdn.aframe.io/a-painter/images/sky.jpg" crossOrigin="anonymous">
<a-asset-item id="left-hand" src="./assets/test2.gltf"></a-asset-item>
<a-asset-item id="opponent-man" src="./assets/opponentMan.gltf"></a-asset-item>
<a-asset-item id="walking-opponent" src="./assets/walking.gltf"></a-asset-item>
<!-- <audio id="song" src="./songs/ocean.mp3" autoPlay loop /> -->
<!-- <a-asset-item id="cloud1" src="./OBJ Models/Cloud_1.obj"></a-asset-item>
<a-asset-item id="cloud1-mtl" src="./OBJ Models/Cloud_1.mtl"></a-asset-item> -->
</a-assets>
<a-sky src="#skymap" geometry="thetaStart: -80"></a-sky>
<a-entity static-body id="ground" geometry="primitive: circle; radius: 30.5" rotation="-90 0 0" material="src: #floor"></a-entity>
<a-entity position="0 0 0">
<a-camera id="camera" wasd-controls-enabled=false>
<a-entity leap-hand="hand: left"></a-entity>
<a-entity leap-hand="hand: right"></a-entity>
</a-camera>
</a-entity>
<a-entity id="opponent" fbx-model="src:./assets/pistol-waiting.fbx" scale="0.02 0.02 0.02" position="-0.067 1.184 -0.34" animation-mixer="loop:pingpong" velocity="">
<a-text id="info-text" value="Grab the gun and follow the gun's path to practice disarming." position="-5.563925580479001 22.351610950003447 4.58432646555616"
scale="3 3 3" text=""></a-text>
<a-circle material="opacity:0.5;side:double;transparent:true;color:#EF2D5E" geometry="radius:0.02" velocity=""></a-circle>
<a-entity id="gun" fbx-model="src:./assets/Extreme_LowPoly.fbx" position="0.314 16.871 6.57" rotation="90 -90 0" scale="0.35 0.35 0.35">
<a-animation attribute="position"
begin="disarm"
dur="4000"
from="0.314 16.871 6.57"
to="0.314 1.544 15"
repeat="0">
</a-animation>
</a-entity>
</a-entity>
<a-circle material="side:double;color:#EF2D5E;transparent:true;opacity:0.5" geometry="radius:0.02"></a-circle>
<a-text id="left-position" value="Left Hand Position" position="-0.40144115907266686 3.06197458956251 -1.524" scale="0.2 0.2 0.2" text=""></a-text>
<a-text id="right-position" value="Right Hand Position" position="0 3.0603799987751894 -1.524" scale="0.2 0.2 0.2" text=""></a-text>
</a-scene>
</body>
</html>