Pan node to specific direction on click

Q&A about the latest versions
Post Reply
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

I might be missing something obvious, but is there a way to pan a node to a specific direction (N, S, E, W) on click of an object?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
Yes you would use a move to view action.
The move to view action can use a pan angle, use the viewing parameters to see which pan angle you would need to use.
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/
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

The problem I was having with that is that each pano would require different parameters in the "move to view" action.

But I did get it to work this way:
Source: Mouse Click
Action: Go to URL
URL: <javascript call here>
Target: _self

Javascript for each compass cardinal point:
Pan to north
javascript:pano.moveTo(pano.getPan()-pano.getPanNorth(),pano.getTilt(),pano.getFov(),5.0);

Pan to south
javascript:pano.moveTo((pano.getPan()-pano.getPanNorth())+180,pano.getTilt(),pano.getFov(),5.0);

Pan to east
javascript:pano.moveTo((pano.getPan()-pano.getPanNorth())-90,pano.getTilt(),pano.getFov(),5.0);

Pan to west
javascript:pano.moveTo((pano.getPan()-pano.getPanNorth())+90,pano.getTilt(),pano.getFov(),5.0);

It works great.

Thanks,
Kevin
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

I should have noted that I am rotating a compass dial with the cardinal points (as the pano pans) around a static compass needle, so the east and west javascript might be reversed based on the individual use or application of this technique.
User avatar
Tony
Posts: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi Kevin,

Thanks for the information re using Go to URL for the pan movement, very helpful.
I should have noted that I am rotating a compass dial with the cardinal points (as the pano pans) around a static compass needle
Can I ask what actions you are using to effect the compass dial rotation?

cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

It's just a modifier:

Target: Rotate
Source: Pan North
Factor: -1
Offset: 0

Note that this is not all my work - I leveraged some assets from others. But here is a component item for it:

Update - I just updated the component to add click spots for Northeast, Southeast, Northwest, and Southwest. Now there are no "dead spots" on the compass dial.

Component attached.
Compass.ggskc
(8.29 KiB) Downloaded 135 times
Post Reply