This is my sample 360ImageView
How do I add Hotspot functionality in aframe panorama,can anybody guide me or give me some clues on how to make this possible
Thanks
This is my sample 360ImageView
How do I add Hotspot functionality in aframe panorama,can anybody guide me or give me some clues on how to make this possible
Thanks
you can simply get the cursor location and create a sphere or a circle entity on that particular location. Here is the code.
function createmarker(){
var b = document.createElement("a-sphere");
var cursor = document.querySelector("a-cursor");
var cursor_pos = new THREE.Vector3().copy(cursor.object3D.getWorldPosition()); // get cursor's world position
b.setAttribute("position", {
"x" : cursor_pos.x,
"y" : cursor_pos.y,
"z" : cursor_pos.z
});
console.log(cursor_pos);
b.setAttribute("radius","0.07");
b.setAttribute("color","#fff");
var a = document.getElementById('aframe-scene');
a.appendChild(b);
}
Here is the aframe html part
<a-scene id="aframe-scene">
<a-sky id="sky" src="/user_images/<%= name %>" id="sky" rotation="0 -130 0"></a-sky>
<a-entity id="enti" camera="userHeight: 1.6" position="0 0 1.6" look-controls wsad-controls mouse-cursor>
<a-cursor style="z-index: 9999">
</a-cursor>
</a-entity>
</a-scene>
you can add a click listener component and add the function createmarker to it. Regarding your query of adding text and images, you can attach the path to the innerHTML of the sphere and create a hover component and on hover take the path from that sphere's inner html and display it near the sphere. For further help you can check out my github repo