Skip to content

Commit 6485af2

Browse files
committed
360VR学习
1 parent e30c067 commit 6485af2

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

360VR/index.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>360VR全景图展示器</title>
7+
<script src="https://www.marzipano.net/demos/common/es5-shim.js"></script>
8+
<script src="https://www.marzipano.net/demos/common/eventShim.js"></script>
9+
<script src="https://www.marzipano.net/demos/common/requestAnimationFrame.js"></script>
10+
<script src="https://www.marzipano.net/build/marzipano.js"></script>
11+
<style>
12+
body {
13+
margin: 0;
14+
padding: 0;
15+
overflow: hidden;
16+
}
17+
#pano {
18+
width: 100%;
19+
height: 100vh;
20+
}
21+
</style>
22+
</head>
23+
<body>
24+
<div id="pano"></div>
25+
26+
<script>
27+
// 初始化查看器
28+
var viewer = new Marzipano.Viewer(document.getElementById("pano"));
29+
30+
// 创建场景
31+
var source = Marzipano.ImageUrlSource.fromString("panorama.jpg");
32+
33+
var geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
34+
35+
var view = new Marzipano.RectilinearView({
36+
yaw: Math.PI,
37+
pitch: 0,
38+
roll: 0,
39+
fov: Math.PI / 2,
40+
});
41+
42+
var scene = viewer.createScene({
43+
source: source,
44+
geometry: geometry,
45+
view: view,
46+
pinFirstLevel: true,
47+
});
48+
49+
// 切换到场景
50+
scene.switchTo();
51+
</script>
52+
</body>
53+
</html>

360VR/panorama.jpg

1.37 MB
Loading

360VR/run.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python -m http.server 8000

0 commit comments

Comments
 (0)