HTML5 hotspot - rotate to view - bug

Q&A about the latest versions
Post Reply
tuesi
Posts: 34
Joined: Fri Oct 22, 2010 12:34 pm

I have two hotspots:

They are in proximity to each other:

When you click on hotspot 1: it takes you to -148.8/-7.7/43.3 (basically zooms in to the hotspot 1 area)
When you click on hotspot 2: it takes you to 125.6/-5.1/40.0 (basically zooms in to the hotspot 2 area)


Here's the bug:
(1) click on hotspot 1...the view tweens correctly.
(2) click on hotspot 2...the view tweens incorrectly. You would expect it to take the shortest path...
(going from pan:125.6 -> -148.8 ...you would think that it would pan 85.6 degrees. However...it actually pans the other way around and spins 125.6 - ( -148.8 ) = 274.4 degrees!)
(3) now if I click back to hotspot 1, the view basically tweens incorrectly the long way around again.

So basically the calculation needs to change: instead of 125 - ( -148.8 ) the code would need to check if there's a +/- transition boundary and then calculate the amount of pan to tween appropriately.
tuesi
Posts: 34
Joined: Fri Oct 22, 2010 12:34 pm

Just want to clarify. I've tested this quite a bit now and it only happens for the -180/+180 boundary, i.e. if you are going between target destinations that are close to the -180 side and then attempt to go to a target destination on the +180 side. It doesn't happen when it crosses 0.
tuesi
Posts: 34
Joined: Fri Oct 22, 2010 12:34 pm

Tried this workaround but it didn't work.

So instead of having negative pan numbers as targets, I added 360 to all of them...thinking that it would help. But this actually doesn't.

I guess the calculation is with the current view position and with the 'move to view' parameter. So if the current view position is -160 and I want to go to 170, the calculation is still 170 - (-160) = 330. The 'move to view' tween still takes the long way around. :cry:
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi
Can you try something for me?
Can you try the below and see if you get the same.
It seems that it wants to rotate to the right, regardless where the hotspot is the first time you click it.
I have found if I rotate to the left and go past the hotspot I want, but still in the screen, then click it, it rotates past the hotspot and carries on to the right until it gets to it from that direction.

However after it has got to the hotspot, it then takes the shortest path as it should, but use a move to default view and it resets this odd behaviour.
This is most defiantly very odd.
Regards
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
tuesi
Posts: 34
Joined: Fri Oct 22, 2010 12:34 pm

Hopki:
I have found if I rotate to the left and go past the hotspot I want, but still in the screen, then click it, it rotates past the hotspot and carries on to the right until it gets to it from that direction.
When I rotate the image to the left past the hotspot...and then click on the hotspot, it duplicates your description...it rotates past the hotspot and carries on to the right until it gets to it from that direction. I even tried spinning it to the left 720 degrees. But after you click on a hotspot, it just spins around 360 to get to the target view.

This I can reproduce consistently...I basically just start off by rotating the image to the left 360 degrees and then I start clicking on hotspots.
If you then rotate the image again 360 and then click on it, it rotates all the way around again. It's as if you're winding up a yoyo. (The code to calculate the delta that you need to rotate needs to be updated. Also my suspicion is that you guys are keeping a variable for the current pan and it goes beyond 360? maybe? It could also be the math for the 180 and -180 that makes things complicated.)

It seems that it wants to rotate to the right, regardless where the hotspot is the first time you click it.
This doesn't always happen to me. I think it only happens when you want to go to a view that has a pan close to -180 (on the negative side)
I have a hotspot and it's visible when the pano first starts. I'm facing 19.5/12.5/60. The hotspot is on the left, near the border of the pano. When I click on it, it uses the shortest distance to bring it into view (target is 49.2/0.0/35.0).


See if you can reproduce this.
  • Create two hotspots: hotspot1 at pan -119.4, hotspot2 at pan 125.6
  • Load the pano...default view is -91.5
  • Rotate the image a little bit to the left...click on hotspot1. (assuming you have code in there...it pans to -119.4)
  • Rotate the image enough to the left to see hotspot2. Click on it. (No my image rotates to the right 360-ish degrees to go to 125.6)
  • Rotate the image enough to the right to see hotspot1. Click on it. (No2 my image rotates to the left 360-ish degrees to go to -119.4)
  • You can repeat this going back and forth between the two hotspots and it continues this behavior!
Post Reply