mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.

Home Page:https://pannellum.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Center view on specific pitch / yaw?

aliMurtaja opened this issue · comments

How will I get the center pitch and yaw value?

The getPitch() and getYaw() API methods.

No, actually I want if I click any hotspot in 360Image, it should automatically be centered on the currently visible area of the image, so that hotspot can't be hidden if the hotspot is placed just nearby the corner of the visible area.

https://github.com/mpetroff/pannellum/assets/49111180/5df00ab6-2cc9-45af-9de2-bf1f297d6661

If you hit the above link, you'll get to see Hotpot is hidden,
I wanted if I had clicked the hotpot, it would have been in the center of the visible area.

I achieved it by using lookAt method.

viewer.lookAt(parseInt(hs.pitchValue), parseInt(hs.pitchYaw))