-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (57 loc) · 1.38 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Brian 3D</title>
<style>
body {
margin: 0;
padding: 0;
background: white;
font-family: Geneva, sans-serif;
}
p {
margin: 0;
padding: 0;
}
a {
color: #3CB371;
}
#viewer {
width: 100%;
height: 100vh;
margin: auto;
background: #000000;
}
canvas {
display: block;
}
</style>
</head>
<body>
<div id="loading" /> </div>
<div class="content">
<div id="viewer"></div>
</div>
</div>
<script src="./3D-me.min.js"></script>
<script src="./3D-me.js"></script>
<script>
var modelPlayer = this['3D-me']
var loadingElement = document.getElementById('loading')
var viewerElement = document.getElementById('viewer')
var scene = modelPlayer.prepareScene(viewerElement)
viewerElement.addEventListener('loading', function (event) {
loadingElement.innerHTML = 'Loading...'
var progress = Math.floor(100 * event.detail.loaded / event.detail.total)
loadingElement.innerHTML = progress + '%'
if (progress === 100){
loadingElement.innerHTML = '';
}
})
//modelPlayer.goFullScreen(viewerElement);
modelPlayer.loadObject(scene, 'assets/brian.obj', 'assets/brian.mtl' , function () {
})
</script>
</body>
</html>