Hi,
So I was puzzling on how to solve this myself.
Basically you need two steps to easily create Link
Hotspots;
First things first, I have now created a way to easily grab yaw and pitch values. Here is STEP 1. I will come up with the second part somewhere this week.
__
In your index.js file goto the function “updateSceneName(scene)”, and change it from
function updateSceneName(scene) {
sceneNameElement.innerHTML =
sanitize(scene.data.name);
}
To
function updateSceneName(scene) {
sceneNameElement.innerHTML =
sanitize(scene.data.name);
window.marzipano_viewer = viewer;
}
__
__
In your index.html
file goto the end of the file and just before </body> paste the
following code.
This code
will implement a small target in your pano. When you click inside the red dot of
the target, it will give you the Yaw + Pitch. You can save these to a text file
for further use.
<style>
.circledot{
height: 18px;
width: 18px;
background-color: #ffffff;
border-radius: 50%;
display: inline-block;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index:1;
}
.biggestdot{
height: 15px;
width: 15px;
background-color: #abcdef;
border-radius: 50%;
display: inline-block;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index:1;
}
.biggerdot{
height: 10px;
width: 10px;
background-color: #abbddd;
border-radius: 50%;
display: inline-block;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index:1;
}
.dot {
height: 5px;
width: 5px;
background-color: #ff0000;
border-radius: 50%;
display: inline-block;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index:1;
}
</style>
<span class="circledot"></span>
<span class="biggestdot"></span>
<span class="biggerdot"></span>
<span class="dot" id="dotje"></span>
<script>
document.getElementById('dotje').addEventListener('click', function(e) {
var lOutputString = "\"new_scene_view_params\": { \"yaw\": " + marzipano_viewer.view().screenToCoordinates({ x: e.clientX, y: e.clientY }).yaw + ", ";
var lOutputString = lOutputString + "\"pitch\": " + marzipano_viewer.view().screenToCoordinates({ x: e.clientX, y: e.clientY }).pitch + ", ";
var lOutputString = lOutputString + "\"roll\": 0, \"fov\": 0.0 }";
console.log(lOutputString);
window.prompt("Here are the values you are looking for;",lOutputString);
});
</script>
__