-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (67 loc) · 2.56 KB
/
index.html
File metadata and controls
76 lines (67 loc) · 2.56 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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | RenderHead</title>
<style>
/* a style sheet needs to be present for cursor hiding and custom cursors to work. */
</style>
</head>
<body>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" height="600px" width="960px"></canvas>
<script type='text/javascript'>
var Module = {
TOTAL_MEMORY: 268435456,
errorhandler: null, // arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
compatibilitycheck: null,
backgroundColor: "#222C36",
splashStyle: "Light",
dataUrl: "Release/WebGLTest.data",
codeUrl: "Release/WebGLTest.js",
asmUrl: "Release/WebGLTest.asm.js",
memUrl: "Release/WebGLTest.mem",
};
</script>
<script src="Release/UnityLoader.js"></script>
<script>
function RemoveBaseUrl(url) {
/*
* Replace base URL in given string, if it exists, and return the result.
*
* e.g. "http://localhost:8000/api/v1/blah/" becomes "/api/v1/blah/"
* "/api/v1/blah/" stays "/api/v1/blah/"
*/
var baseUrlPattern = /^https?:\/\/[a-z\:0-9.]+/;
var result = "";
var match = baseUrlPattern.exec(url);
if (match != null) {
result = match[0];
}
if (result.length > 0) {
url = url.replace(result, "");
}
return url;
}
function SendThemMessages()
{
// https://www.dropbox.com/sh/zmch6hfzc97rvbb/AAA3dfsDDX4IisxFmS9kJaTLa/focal_length_800_v3_with_seg/2339510439_1_texture.png?dl=0
var mtexturepath = RemoveBaseUrl(document.getElementById('textureUrl').value);
var mmeshpath = RemoveBaseUrl(document.getElementById('meshUrl').value);
SendMessage("Main Camera","SetTextureUrl", "https://dl.dropboxusercontent.com" + mtexturepath);
SendMessage("Main Camera","SetMeshUrl", "https://dl.dropboxusercontent.com" + mmeshpath);
}
function Apply()
{
SendThemMessages();
SendMessage("Main Camera","ExternalApplyAvatar");
}
</script>
<br>
Mesh url: <input name="Mesh Url" type="text" id="meshUrl" value="https://www.dropbox.com/sh/zmch6hfzc97rvbb/AABcZT_D95G_8owHeax-IvUKa/focal_length_800_v3_with_seg/haomam_neutral_adjust.obj?dl=0"/>
<br>
Texture url: <input name="Texture Url" type="text" id="textureUrl" value="https://www.dropbox.com/sh/zmch6hfzc97rvbb/AABqopgjSv0tn7xDHpBzNH43a/focal_length_800_v3_with_seg/haomam_texture.png?dl=0"/>
<br>
<input id="clickMe" type="button" value="Apply" onclick="Apply();" />
</body>
</html>