3D球形實景-全景漫遊
# FastWeb 3D球形實景-全景漫遊
3D球形實景-全景漫遊使用的是pano2vr產生的HTML專案。通過下列的方式可以帶大家瞭解如何在FastWeb中引入此型別的專案。
# 1. 下載示例
此專案會包含在library/js/obj2vr/vroffice
中,如有需要可從中複製此目錄中的檔案進行操作。此目錄中的
# 2. 確認參數
使用的線上示例的樣式內容如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="mobile-web-app-capable" content="yes" />
<style type="text/css" title="Default">
/* fullscreen */
html {
height:100%;
}
body {
height:100%;
margin: 0px;
overflow:hidden; /* disable scrollbars */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* remove highlight on tab for iOS/Android */
}
/* fix for scroll bars on webkit & >=Mac OS X Lion */
::-webkit-scrollbar {
background-color: rgba(0,0,0,0.5);
width: 0.75em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,0.5);
}
</style>
</head>
<body>
<!-- - - - - - - 8<- - - - - - cut here - - - - - 8<- - - - - - - -->
<script type="text/javascript" src="pano2vr_player.js">
</script>
<script type="text/javascript" src="skin.js">
</script>
<script src="webxr/three.min.js"></script>
<script src="webxr/webxr-polyfill.min.js"></script>
<div id="container" style="width:100%;height:100%;overflow:hidden;">
<br>Loading...<br><br>
</div>
<script type="text/javascript">
// create the panorama player with the container
pano=new pano2vrPlayer("container");
// add the skin object
skin=new pano2vrSkin(pano);
// load the configuration
window.addEventListener("load", function() {
pano.readConfigUrlAsync("pano.xml");
});
if (window.navigator.userAgent.match(/AppleWebKit/i)) {
// fix for white borders, rotation on iPhone
function iosHfix(e) {
window.scrollTo(0, 1);
var container=document.getElementById("container");
var oh=container.offsetHeight;
document.documentElement.style.setProperty('height', '100vh');
if (oh!=container.offsetHeight) {
container.style.setProperty('height',"100%");
} else {
container.style.setProperty('height',window.innerHeight+"px");
}
window.scrollTo(0, 0);
pano.setViewerSize(container.offsetWidth, container.offsetHeight);
};
setTimeout(iosHfix,0);
setTimeout(iosHfix,100);
window.addEventListener("resize", function() {
setTimeout(iosHfix,0);
// hide toolbar on iPad happens with a delay
setTimeout(iosHfix,500);
setTimeout(iosHfix,1000);
setTimeout(iosHfix,2000);
});
}
</script>
<noscript>
<p><b>Please enable Javascript!</b></p>
</noscript>
<!-- - - - - - - 8<- - - - - - cut here - - - - - 8<- - - - - - - -->
</body>
</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
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
# 3. 修改模板
# 3.1. 本地化處理
由於需要引入到jQuery元件中,需要對部分鏈接的地址進行修改,修改後的地址如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="mobile-web-app-capable" content="yes" />
<style type="text/css" title="Default">
/* fullscreen */
html {
height:100%;
}
body {
height:100%;
margin: 0px;
overflow:hidden; /* disable scrollbars */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* remove highlight on tab for iOS/Android */
}
/* fix for scroll bars on webkit & >=Mac OS X Lion */
::-webkit-scrollbar {
background-color: rgba(0,0,0,0.5);
width: 0.75em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,0.5);
}
</style>
</head>
<body>
<!-- - - - - - - 8<- - - - - - cut here - - - - - 8<- - - - - - - -->
<script type="text/javascript" src="library/js/obj2vr/vroffice/pano2vr_player.js">
</script>
<script type="text/javascript" src="library/js/obj2vr/vroffice/skinlib.js">
</script>
<script src="library/js/obj2vr/vroffice/webxr/three.min.js"></script>
<script src="library/js/obj2vr/vroffice/webxr/webxr-polyfill.min.js"></script>
<div id="container" style="width:100%;height:100%;overflow:hidden;">
<br>Loading...<br><br>
</div>
<script type="text/javascript">
/* create the panorama player with the container */
pano=new pano2vrPlayer("container");
/* add the skin object */
skin=new pano2vrSkin(pano);
/* load the configuration */
window.addEventListener("load", function() {
/*下面的地址處請修改爲FastWeb相對的地址*/
pano.readConfigUrlAsync("library/js/obj2vr/vroffice/pano.xml");
});
if (window.navigator.userAgent.match(/AppleWebKit/i)) {
/* fix for white borders, rotation on iPhone */
function iosHfix(e) {
window.scrollTo(0, 1);
var container=document.getElementById("container");
var oh=container.offsetHeight;
document.documentElement.style.setProperty('height', '100vh');
if (oh!=container.offsetHeight) {
container.style.setProperty('height',"100%");
} else {
container.style.setProperty('height',window.innerHeight+"px");
}
window.scrollTo(0, 0);
pano.setViewerSize(container.offsetWidth, container.offsetHeight);
};
setTimeout(iosHfix,0);
setTimeout(iosHfix,100);
window.addEventListener("resize", function() {
setTimeout(iosHfix,0);
/* hide toolbar on iPad happens with a delay */
setTimeout(iosHfix,500);
setTimeout(iosHfix,1000);
setTimeout(iosHfix,2000);
});
}
</script>
<noscript>
<p><b>Please enable Javascript!</b></p>
</noscript>
<!-- - - - - - - 8<- - - - - - cut here - - - - - 8<- - - - - - - -->
</body>
</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
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
在上文對應的vroffice
資料夾中找到skin.js
,複製新增此檔案,並修改其名稱為skinlib.js
,使用文字編輯器搜索其中的images/preview_nodeimage_
,將所有的顯示為上述內容的部分修改替換為library/js/obj2vr/vroffice/images/preview_nodeimage_
。修改完成後儲存檔案。
通過上述方式建立完成後,可進入JQueryFrame元件管理界面,將上述html的內容填寫入模板中,建議使用URLFrame容器引入。