Gyroscope enabling/disabling

Q&A about the latest versions
Post Reply
Bostjan
Posts: 366
Joined: Fri Oct 17, 2008 4:06 pm

Gyroscope enabling/disabling

Post by Bostjan » Mon Jan 02, 2012 3:41 pm

Is there a way to enable/disable Gyroscope from the skin?

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

Re: Gyroscope enabling/disabling

Post by Hopki » Tue Jan 03, 2012 4:01 pm

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)

MalcolmD
Posts: 4
Joined: Wed Feb 02, 2011 11:43 am

Re: Gyroscope enabling/disabling

Post by MalcolmD » Tue Jan 17, 2012 9:14 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: 9653
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Re: Gyroscope enabling/disabling

Post by Hopki » Tue Jan 17, 2012 10:10 am

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 628 times

MalcolmD
Posts: 4
Joined: Wed Feb 02, 2011 11:43 am

Re: Gyroscope enabling/disabling

Post by MalcolmD » Tue Jan 17, 2012 4:19 pm

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

Re: Gyroscope enabling/disabling

Post by PORTtours » Tue Jan 24, 2012 3:13 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: 817
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Re: Gyroscope enabling/disabling

Post by Tony » Fri Mar 02, 2012 12:46 pm

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: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/

JohnGore
Posts: 19
Joined: Mon Apr 19, 2010 12:09 am

Re: Gyroscope enabling/disabling

Post by JohnGore » Sun Nov 11, 2012 12:29 pm

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

Re: Gyroscope enabling/disabling

Post by MMünch » Mon May 23, 2016 6:00 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: 89
Joined: Tue Jan 10, 2012 1:59 pm
Location: London, UK
Contact:

Re: Gyroscope enabling/disabling

Post by Chu » Wed May 25, 2016 1:54 pm

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!
2016-05-25 12_51_50-Pano2VR pro 5.0.1 - 64bit.png
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 5699 times
2016-05-25 12_52_22-HTML Template.png
Does what it says on the tin
2016-05-25 12_52_22-HTML Template.png (8.1 KiB) Viewed 5699 times
Using:
Pano2VR PRO 6.1.0 pro 64bit
build 17841/5.12.2

fancybox v3.2.5
Windows 10 v1709
Human Brain v1.0

Image

Artwork
  • Aerosol
  • Design
  • Screen
Specialist
  • 360°
  • Stereoscopy
  • Illusions
Concept
  • Consultancy
  • Campaigns
  • Data
  • Education
est.1971

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

Re: Gyroscope enabling/disabling

Post by MMünch » Wed May 25, 2016 2:46 pm

Oh, sorry... I didn't see this selection... Thanks a lot!

MellowMoon
Posts: 1
Joined: Fri Dec 02, 2016 1:55 pm

Re: Gyroscope enabling/disabling

Post by MellowMoon » Fri Dec 02, 2016 4:47 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

Who is online

Users browsing this forum: Google [Bot] and 14 guests