forked from JeremyHeleine/Photo-Sphere-Viewer
-
-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
758 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>PhotoSphereViewer - overlays cubemap demo</title> | ||
|
||
<link rel="stylesheet" href="/dist/core/index.css" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<div id="photosphere"></div> | ||
|
||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "/node_modules/three/build/three.module.js", | ||
"@photo-sphere-viewer/core": "/dist/core/index.module.js", | ||
"@photo-sphere-viewer/cubemap-adapter": "/dist/cubemap-adapter/index.module.js", | ||
"@photo-sphere-viewer/overlays-plugin": "/dist/overlays-plugin/index.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import { Viewer } from '@photo-sphere-viewer/core'; | ||
import { CubemapAdapter } from '@photo-sphere-viewer/cubemap-adapter'; | ||
import { OverlaysPlugin } from '@photo-sphere-viewer/overlays-plugin'; | ||
|
||
const baseUrl = 'https://photo-sphere-viewer-data.netlify.app/assets/'; | ||
|
||
const viewer = new Viewer({ | ||
container: 'photosphere', | ||
adapter: CubemapAdapter, | ||
panorama: { | ||
left: baseUrl + 'cubemap/px.jpg', | ||
front: baseUrl + 'cubemap/nz.jpg', | ||
right: baseUrl + 'cubemap/nx.jpg', | ||
back: baseUrl + 'cubemap/pz.jpg', | ||
top: baseUrl + 'cubemap/py.jpg', | ||
bottom: baseUrl + 'cubemap/ny.jpg', | ||
}, | ||
caption: 'Parc national du Mercantour <b>© Damien Sorel</b>', | ||
loadingImg: baseUrl + 'loader.gif', | ||
plugins: [ | ||
[OverlaysPlugin, { | ||
overlays: [ | ||
{ | ||
id: 'xray', | ||
path: { | ||
left: baseUrl + 'cubemap-overlay/px.png', | ||
front: baseUrl + 'cubemap-overlay/nz.png', | ||
right: baseUrl + 'cubemap-overlay/nx.png', | ||
back: baseUrl + 'cubemap-overlay/pz.png', | ||
top: baseUrl + 'cubemap-overlay/py.png', | ||
bottom: baseUrl + 'cubemap-overlay/ny.png', | ||
}, | ||
opacity: .8, | ||
zIndex: 1, | ||
}, | ||
// { | ||
// id: 'xray', | ||
// path: baseUrl + 'sphere-overlay.png', | ||
// opacity: .8, | ||
// zIndex: 1, | ||
// }, | ||
], | ||
}], | ||
], | ||
}); | ||
|
||
window.viewer = viewer; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>PhotoSphereViewer - overlays demo</title> | ||
|
||
<link rel="stylesheet" href="/dist/core/index.css" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<div id="photosphere"></div> | ||
|
||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "/node_modules/three/build/three.module.js", | ||
"@photo-sphere-viewer/core": "/dist/core/index.module.js", | ||
"@photo-sphere-viewer/overlays-plugin": "/dist/overlays-plugin/index.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import { Viewer } from '@photo-sphere-viewer/core'; | ||
import { OverlaysPlugin } from '@photo-sphere-viewer/overlays-plugin'; | ||
|
||
const baseUrl = 'https://photo-sphere-viewer-data.netlify.app/assets/'; | ||
|
||
const viewer = new Viewer({ | ||
container: 'photosphere', | ||
panorama: baseUrl + 'sphere.jpg', | ||
caption: 'Parc national du Mercantour <b>© Damien Sorel</b>', | ||
loadingImg: baseUrl + 'loader.gif', | ||
plugins: [ | ||
[OverlaysPlugin, { | ||
overlays: [ | ||
{ | ||
id: 'xray', | ||
path: baseUrl + 'sphere-overlay.png', | ||
opacity: .8, | ||
zIndex: 1, | ||
}, | ||
{ | ||
path: baseUrl + 'sphere-small.jpg', | ||
opacity: 0.5, | ||
yaw: -0.81, | ||
pitch: 0.19, | ||
width: 0.8, | ||
height: 0.4, | ||
zIndex: 2, | ||
}, | ||
{ | ||
id: 'rick', | ||
path: baseUrl + 'pictos/rick.webm', | ||
type: 'video', | ||
yaw: 0, | ||
pitch: 0.19, | ||
width: 0.2, | ||
height: 0.4, | ||
zIndex: 3, | ||
} | ||
], | ||
}], | ||
], | ||
}); | ||
|
||
const overlays = viewer.getPlugin('overlay'); | ||
|
||
overlays.addEventListener('overlay-click', ({overlayId}) => { | ||
if (overlayId === 'rick') { | ||
const video = overlays.getVideo(overlayId); | ||
if (video.paused) { | ||
video.play(); | ||
} else { | ||
video.pause(); | ||
} | ||
} | ||
}); | ||
|
||
window.viewer = viewer; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.