Gyroscope enabling/disabling

Q&A about the latest versions
Post Reply
Bostjan
Posts: 421
Joined: Fri Oct 17, 2008 4:06 pm
Location: Slovenia, EU
Contact:

Is there a way to enable/disable Gyroscope from the skin?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi
Yes there is a way but not straight forward.
In you skin create your button with a unique ID, say gyro.
Now give it a Mouse Click, Pano Left action. This could be any action, not necessarily pan left, but this makes it easy to spot.

Output the HTML5 project.

Open the Skin.js file with a text editor. Now Find gyro. You are looking for:


Code: Select all

this._gyro.onclick=function () {
			me.player.changePan(1,true);
		}

replace me.player.changePan(1,true); with gyro.toggle(); so it looks like this:

Code: Select all

this._gyro.onclick=function () {
			gyro.toggle();
		}
Now save the text file. You may wish to save it with a different name and then change the HTML page to look for it.

This will now toggle the gyro function.
Regards
Hopki (with input from Thomas)
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/
MalcolmD
Posts: 4
Joined: Wed Feb 02, 2011 11:43 am

Hopki

Thanks for this method, which I have tried, and it works fine, but it appears to require a bespoke skin and HTML page for each panorama.

If the gyro.toggle() function could be accessed directly through the skin editor then presumably it could be added to a skin via a button and then would be easily available in all panoramas?

If that's the case, then could you log this as a request with Thomas?

Many thanks

MalcolmD
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi
Yes this would be nice to be able to do this from the skin editor so I will add this as to the feature list in the bug tracker.
However this is a skin driven toggle function that works in all nodes of a VT.

Remember you only need one html page and one skin for a multi node tour.

Please find attached a project that does just this.
I have renamed the skin.js to gyro_skin.js.
Output the project as normal, then delete the skin.js made by pano2vr.
Copy the gyro_skin.js and rename it to skin.js to replace the first.

As you go between node one and two you can toggle gyro on and off at ant point.

==EDIT==
Please see Issue #420

Regards
Hopki
Attachments
Gyro.zip
(150.07 KiB) Downloaded 886 times
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/
MalcolmD
Posts: 4
Joined: Wed Feb 02, 2011 11:43 am

Hopki

Many thanks for the HTML/skin models and for logging this on the "to do" list.

MalcolmD
PORTtours
Posts: 36
Joined: Tue Jan 24, 2012 2:00 pm

Hi, I'm new to the forums (love all the help you guys give on here!). The gyro code works well, but is there a way to have the gyro turned off initially? I tried init for a pan left, and then made it zero, but I wouldn't know what I'm looking for exactly in the code to make that become "gyro."

Thanks

Frank
User avatar
Tony
Posts: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

PORTtours wrote:is there a way to have the gyro turned off initially?
I'm also interested in finding out if there is a way to start with Gyro "off" and then have the user turn it on. Has anyone managed to implement the function this way yet?

thanks,

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/
JohnGore
Posts: 19
Joined: Mon Apr 19, 2010 12:09 am

Just as a record (I see this page has not yet been updated), there is now a very easy way to make a gyro on / off toggle button (as per bug fix: http://gardengnomesoftware.com/bt/print ... bug_id=420)

Code: Select all

you can now add javascript code in the Goto URL action. To toogle the gyroscope simple add
javascript:gyro.toggle();
as the URL in the Goto URL action. To enable/disable the Gyro call:
javascript:gyro.enable();
javascript:gyro.disable();
Works very well.

But does anyone know of a way to start with gyro OFF by default ?

tks
MMünch
Posts: 3
Joined: Mon May 23, 2016 1:18 pm

It also works for me, but I also would see a function that disables the gyroscope at start of the Panorama.

Is there a way to set "javascript:gyro.disable();" at the start by default? Please!
User avatar
Chu
Posts: 97
Joined: Tue Jan 10, 2012 1:59 pm
Location: London, UK
Contact:

MMünch wrote:It also works for me, but I also would see a function that disables the gyroscope at start of the Panorama.

Is there a way to set "javascript:gyro.disable();" at the start by default? Please!
Slect the little tools/settings icon tot he right of the HTML Template selector
Slect the little tools/settings icon tot he right of the HTML Template selector
2016-05-25 12_51_50-Pano2VR pro 5.0.1 - 64bit.png (19.3 KiB) Viewed 11721 times
Does what it says on the tin
Does what it says on the tin
2016-05-25 12_52_22-HTML Template.png (8.1 KiB) Viewed 11721 times
Using:
Pano2VR PRO 6.1.15 pro 64bit
build 18116/5.12.2

Windows 10 x64
Human Brain v1.3

Image

est.1971
MMünch
Posts: 3
Joined: Mon May 23, 2016 1:18 pm

Oh, sorry... I didn't see this selection... Thanks a lot!
MellowMoon
Posts: 1
Joined: Fri Dec 02, 2016 1:55 pm

Hello together,
I have implemented the gyroscope enabling/disabling button in the "Normal" Skin and exported the Output to html5 with the skin settings described in the last post (Include gyroscope Control, Disable on Startup) and in addition "use true North".
After opening the tour this function is working fine. I can enable or disable this function and the gyroscope is working correctly when enabled. Panorama change via hotspots is possible.
The Problem occurs when trying to open an image-hotspot. :shock:
It doesn´t matter if the gyroscope was enabled or disabled before. When choosing the image-hotspot the popup window with the image appears but you can´t close the popup widow anymore. Other menue features like full screen, map view or autorotation don´t work. If gyro is enabled I can still move the mobile and the panorama is moving behind the image accordingly. The image seems to be frozen, is covered by the semitransparent backlayer and the brightness of the image is reduced.
The same tour is working without gyroscope Control Output correctly and image-popups can be closed.
Is this bug known and is there a workaround to solve this problem? This is a very nice feature but useless if not possible to add Image hotspots in the tour.

Used Version: Pano2VR5 v5.03

Many thanks for the fantastic Support so far.
Best regards,
Markus
Post Reply