-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.dev.html
92 lines (75 loc) · 2.98 KB
/
index.dev.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href='https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:700' rel='stylesheet' type='text/css'>
<link href="css/style.css" rel='stylesheet' type='text/css'>
<script src="lib/jquery.js"></script>
<script src="lib/three72.js"></script>
<script src="lib/OrbitControls.js"></script>
<script src="scripts/helvetiker_regular.typeface.js"></script>
<script src="lib/Tween.js"></script>
<!--<script src="build/backgammon.js"></script>-->
<script src="scripts/backgammon-3d-board.js"></script>
<script src="scripts/stats.js"></script>
<script src="scripts/board-loader.js"></script>
<script src="scripts/manager.js"></script>
<script src="scripts/position-map-generator.js"></script>
<script src="scripts/DAC.js"></script>
<script src="scripts/dice.js"></script>
<script src="scripts/dice-manager.js"></script>
<script src="scripts/picker.js"></script>
<script src="scripts/checker-picker.js"></script>
<script src="scripts/double-cube-picker.js"></script>
<script src="scripts/checker-manager.js"></script>
<script src="scripts/double-cube-manager.js"></script>
<script src="scripts/game-helper.js"></script>
<script src="scripts/helvetiker_regular.typeface.js"></script>
<!--<script src="scripts/module-exporter.js"></script>-->
<script src="scripts/movement-manager.js"></script>
<script src="scripts/optimization-manager.js"></script>
<!--<script src="scripts/PhysicsManager.js"></script>-->
<script src="scripts/platform-detector.js"></script>
<script src="scripts/text-writer.js"></script>
</head>
<body>
<div id="tools">
<a data-state="0" id="demo">Demo</a>
<a data-state="0" id="roll">R. Roll</a>
<input type="file" id="boardMap"/>
<input type="file" id="boardSpecularMap"/>
<input type="file" id="boardBumpMap"/>
</div>
<div id="canvas"></div>
<script src="scripts/main.js"></script>
<script>
var boardMap = document.querySelector('#boardMap');
var boardSpecularMap = document.querySelector('#boardSpecularMap');
var boardBumpMap = document.querySelector('#boardBumpMap');
changeTexture(boardMap, 'map');
changeTexture(boardSpecularMap, 'specularMap');
changeTexture(boardBumpMap, 'bumpMap');
function changeTexture( source, name ){
source.onchange = function(e){
onChange(e, name);
}
}
function onChange(e,name){
window.material = board_manager.scene.getChildByName('Board_03').material
var board = board_manager.scene.getObjectByName('Board_03');
var reader = new FileReader();
reader.onload = function(e) {
var image = document.createElement('img');
image.src = e.target.result;
var texture = new THREE.Texture(image);
texture.needsUpdate = true;
material[name] = texture;
material.map.needsupdate = true;
material.needsUpdate = true;
}
reader.readAsDataURL( boardMap.files[0] );
}
</script>
</body>
</html>