mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.16k stars 712 forks source link

Fixed Custom-hotspot on screen #1083

Closed MASPCHINE closed 2 years ago

MASPCHINE commented 2 years ago

Hi, i changed the display of hotspots but I want to fix the hotspots location on the screen rather than on the photo. I want hotspots to follow the screen when I navigate through the panoramic view can i do this ?

I want to give perspective to hotspots my goal is to get hotspots more flat on the ground ransform-style: preserve-3d; transform: translateZ(-100px);

I tried something like this but it didn't work I want to do something like this;

button

Is it possible to do this?

MASPCHINE commented 2 years ago

p = "translate(" + f[0] + "px, " + f[1] + "px) translateZ(9999px) rotate(" + b.roll + "deg)"; a.scale && (p += " scale(" + ra / b.hfov / h + ")"); I close this code lines from panellum.js and I add to this code line on pannellum.css ; .custom-hotspot-front { position: absolute; visibility: visible; cursor: default; vertical-align: middle; left: 350px; top: 630px; z-index: 1; height: 55px; width: 61px; background-image: url("forward.png"); background-repeat: no-repeat; background-position: 6px 0px; transform: perspective(150px) rotateX(60deg) scale(1.2); } Done!