-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
63 lines (58 loc) · 2.6 KB
/
index.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<html>
<head>
<meta charset="utf-8">
<title>A-Craft</title>
<meta name="description" content="A-Craft">
<script type="text/javascript" src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/aframe-teleport-controls/dist/aframe-teleport-controls.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/aframe-controller-cursor-component/dist/aframe-controller-cursor-component.min.js"></script>
<!--<script type="text/javascript" src="https://unpkg.com/aframe-motion-capture-components/dist/aframe-motion-capture-components.min.js"></script>-->
<script type="text/javascript" src="components/intersection-spawn.js"></script>
<script type="text/javascript" src="components/random-texture.js"></script>
<script type="text/javascript" src="components/snap.js"></script>
<script type='text/javascript'>//<![CDATA[
document.addEventListener("DOMContentLoaded", function () {
document.querySelector("a-scene").addEventListener("contextmenu", function (event) {
event.cancelBubble = true;
event.returnValue = false;
event.stopPropagation();
event.preventDefault();
// Add whatever you need to add when you right-click
return false;
});
});
//]]></script>
</head>
<body>
<a-scene avatar-recorder>
<a-assets>
<img id="groundTexture" src="https://raw.githubusercontent.com/OpenLabsHackerspace/a-craft/master/textures/ground.png">
<img id="skyTexture" src="https://2.bp.blogspot.com/-snwVIHMhZH8/UZGQ5YnLctI/AAAAAAAAHpo/k8Rhl1noy0w/s1600/10.jpg">
<a-mixin id="voxel"
geometry="primitive: box; height: 0.5; width: 0.5; depth: 0.5"
material="shader: standard"
random-texture
snap="offset: 0.25 0.25 0.25; snap: 0.5 0.5 0.5"
></a-mixin>
</a-assets>
<a-sky id="bg" radius="30" src="#skyTexture" theta-length="90"></a-sky>
<a-cylinder id="ground" src="#groundTexture" radius="32" height="0.1"></a-cylinder>
<!-- Hands. -->
<a-entity id="teleHand"
hand-controls="left"
teleport-controls="type: parabolic; collisionEntities: [mixin='voxel'], #ground"
></a-entity>
<a-entity id="blockHand"
hand-controls="right"
controller-cursor
intersection-spawn="event: click; mixin: voxel"
></a-entity>
<!-- Camera. -->
<a-camera>
<a-cursor
intersection-spawn="event: click; mixin: voxel"
></a-cursor>
</a-camera>
</a-scene>
</body>
</html>