pannellum icon indicating copy to clipboard operation
pannellum copied to clipboard

Get the pitch, yaw, hfov after dragging?

Open romeltech opened this issue 3 years ago • 4 comments

How do I get the Hotspot position of pitch, yaw, hfov after dragging the Hotspot? Or is there any workaround to achieve this?

romeltech avatar Sep 10 '20 06:09 romeltech

I actually made it to work by targetting the hotspot div and using the mouseup event. Is there any workaround for this? $(".custom-hotspot").on("mouseup", function (e) { console.log(viewer.mouseEventToCoords(e)); });

romeltech avatar Sep 10 '20 10:09 romeltech

I assume you're using the recently added hot spot dragging functionality. As noted in the documentation for the dragHandlerFunc parameter, the specified function is called when hot spot dragging starts and ends. As the mouse event is passed to this function, you can use mouseEventToCoords in it.

mpetroff avatar Sep 10 '20 15:09 mpetroff

Hi @mpetroff, using mouseEventToCoords only prints the pitch and yaw of the click location. Is there a way to get the HFOV or the pitch/yaw of the center of the screen?

joshuakoh1 avatar May 28 '21 06:05 joshuakoh1

@joshuakoh1 You can use the .getPitch(), .getYaw(), and getHfov() methods on the Viewer object.

mpetroff avatar Jun 09 '21 15:06 mpetroff