-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
69 lines (61 loc) · 4.97 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
64
65
66
67
68
69
<html>
<head>
<title>aframe chess</title>
<script src="https://rawgit.com/ngokevin/aframe/animationbugless/dist/aframe-master.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component@4.0.0-beta8/dist/aframe-animation-component.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@^4.0.0/dist/aframe-event-set-component.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.0.1/dist/aframe-physics-system.min.js"></script>
<script src="js/components.js"></script>
<script src="js/chessboard.js"></script>
<script src="https://rawgit.com/feiss/aframe-environment-component/master/dist/aframe-environment-component.min.js"></script>
</head>
<body>
<a-scene environment="preset: egypt; fog: 0.8" stats light="defaultLightsEnabled: false">
<a-assets>
<a-mixin id="tile"
geometry="primitive: box; depth: 0.2; width: 1; height: 1"
material="">
<!-- event-set__enter="_event: mouseenter;scale: 1 1 1.1;"
event-set__leave="_event: mouseleave;scale: 1 1 1;" -->
</a-mixin>
<a-mixin id="piece" scale="0.05 0.05 0.05" rotation="-90 0 0"></a-mixin>
<a-asset-item id="pawnObj" src="assets/pawn.obj"></a-asset-item>
<a-asset-item id="knightObj" src="assets/knight.obj"></a-asset-item>
<a-asset-item id="rookObj" src="assets/rook.obj"></a-asset-item>
<a-asset-item id="bishopObj" src="assets/bishop.obj"></a-asset-item>
<a-asset-item id="kingObj" src="assets/king.obj"></a-asset-item>
<a-asset-item id="queenObj" src="assets/queen.obj"></a-asset-item>
<a-asset-item id="whiteMtl" src="assets/white.mtl"></a-asset-item>
<a-asset-item id="blackMtl" src="assets/black.mtl"></a-asset-item>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackpawn" obj-model="obj: #pawnObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackknight" obj-model="obj: #knightObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackrook" obj-model="obj: #rookObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackbishop" obj-model="obj: #bishopObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackking" obj-model="obj: #kingObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="blackqueen" obj-model="obj: #queenObj; mtl: #blackMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whitepawn" obj-model="obj: #pawnObj; mtl: #whiteMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whiteknight" obj-model="obj: #knightObj; mtl: #whiteMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whiterook" obj-model="obj: #rookObj; mtl: #whiteMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whitebishop" obj-model="obj: #bishopObj; mtl: #whiteMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whiteking" obj-model="obj: #kingObj; mtl: #whiteMtl"></a-mixin>
<a-mixin dynamic-body="shape: box;angularDamping: 0.9" id="whitequeen" obj-model="obj: #queenObj; mtl: #whiteMtl"></a-mixin>
</a-assets>
<a-sky color="#4c5056"></a-sky>
<a-entity light="type: point; color: white; intensity: 1" position="-4 7 -5"></a-entity>
<a-entity light="type: ambient; color: white; intensity: 0.4"></a-entity>
<!-- Board container - all positions will be relative to the ones of the container so we can move the board around later -->
<a-plane board color="black" id="boardContainer" rotation="90 0 0" width="8" height="8" position="-4 0 -10">
<!-- tiles & pieces will be created and placed at the initialization of the board component -->
</a-plane>
<!-- this is our floor -->
<a-box width="75" height="0.2" depth="75" static-body visible="false"></a-box>
<!-- Oh and this is the viewer initial position -->
<a-entity position="0 1 0">
<a-camera>
<a-cursor geometry="primitive: ring; radiusOuter: 0.05; radiusInner: 0.03" material="color: firebrick"></a-cursor>
</a-camera>
</a-entity>
</a-scene>
<a href="https://github.com/macmorning/aframe-chess"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
</body>
</html>