You are not logged in.

> The forum rules have been updated. Please take a moment to read them.


#1 2011-11-28 12:55:06

scoopz
Member
Registered: 2011-11-28
Posts: 27

Gyroscope on/off button?

I notice if I enable the gyro feature for iOS tours, when the tour loads the gyro mode is automatically enabled and there doesn't seem to be an option to disable it?

Is it possible to have a gyro On/Off button in the navigation toolbar somehow?

Offline

 

#2 2011-12-01 20:58:56

Jeremiah
Member
Registered: 2011-10-31
Posts: 29

Re: Gyroscope on/off button?

It can be done, but as far as I know, you have to edit the xml to achieve it.

http://test.anra.org/gyrotest (this url is for my testing, so it will not be available indefinitely)

You'll need to have a couple of images to use as buttons:
http://test.anra.org/gyrotest/builddata … nabled.png
http://test.anra.org/gyrotest/builddata/graphics/menu/menu-gyro-enabled.png
http://test.anra.org/gyrotest/builddata … sabled.png
http://test.anra.org/gyrotest/builddata/graphics/menu/menu-gyro-disabled.png

and you'll need to add a couple of buttons to the menu section of the xml:

Code:

<plugin name="gyroOFF" align="bottom" blendmode="normal" crop="0|0|65|65" customColor="true" height="prop" keep="true" onclick="switch(plugin[gyro].enabled);set(plugin[gyroOFF].visible,false); set(plugin[gyroON].visible,true);" onout="" onover="" onovercrop="0|65|65|65" url="builddata/graphics/menu/menu-gyro-enabled.png" visible="" width="40" x="200" y="10"/>
    <plugin name="gyroON" align="bottom" blendmode="normal" crop="0|0|65|65" customColor="true" height="prop" keep="true" onclick="switch(plugin[gyro].enabled);set(plugin[gyroON].visible,false); set(plugin[gyroOFF].visible,true);" onout="" onover="" onovercrop="0|65|65|65" url="builddata/graphics/menu/menu-gyro-disabled.png" visible="false" width="40" x="200" y="10"/>

and you may also want to add something to the firstloadcompleteadedaction to hide the button on devices where it doesn't make sense:

Code:

    <action name="firstloadcompleteaction">
        if(plugin[data].firstPanoHasBeenPlayed==false,
            set(plugin[data].firstPanoHasBeenPlayed,true);
            set(autorotate.enabled,false);
        );
        <!--hide gyro button if we're not on an html5 device-->
        <!-- this really should be something like "if(plugin[gyro].available==false,", but I can't get it to work-->

        if(ishtml5==false,
            set(plugin[gyroOFF].visible,false);
        );
    </action>

Hope that helps. I'll update if I figure out how to get the button to hide properly.

Offline

 

#3 2011-12-01 23:04:44

Jeremiah
Member
Registered: 2011-10-31
Posts: 29

Re: Gyroscope on/off button?

ok, this makes a bit more sense, but I'm still not sure that it would hide the gyro button on devices that are html5, but don't have a gyro, such as the first gen iPad or some android phones. Anyone care to test?

http://test.anra.org/gyrotest

first, make both the enabled and disabled buttons hidden to start:

Code:

<plugin name="gyroOFF" align="bottom" blendmode="normal" crop="0|0|65|65" customColor="true" height="prop" keep="true" onclick="switch(plugin[gyro].enabled);set(plugin[gyroOFF].visible,false); set(plugin[gyroON].visible,true);" onout="" onover="" onovercrop="0|65|65|65" url="builddata/graphics/menu/menu-gyro-enabled.png" visible="false" width="40" x="200" y="10"/>
    <plugin name="gyroON" align="bottom" blendmode="normal" crop="0|0|65|65" customColor="true" height="prop" keep="true" onclick="switch(plugin[gyro].enabled);set(plugin[gyroON].visible,false); set(plugin[gyroOFF].visible,true);" onout="" onover="" onovercrop="0|65|65|65" url="builddata/graphics/menu/menu-gyro-disabled.png" visible="false" width="40" x="200" y="10"/>

Then, only make the disable button visible, if the gyro plugin reports that it is "enabled"

Code:

    <action name="firstloadcompleteaction">
        if(plugin[data].firstPanoHasBeenPlayed==false,
            set(plugin[data].firstPanoHasBeenPlayed,true);
            set(autorotate.enabled,false);
        );
        <!--show gyro button if we're on an html5 device that supports it-->
        if(plugin[gyro].enabled==true,
            set(plugin[gyroOFF].visible,true);
        );
    </action>

Offline

 

#4 2011-12-05 13:25:11

scoopz
Member
Registered: 2011-11-28
Posts: 27

Re: Gyroscope on/off button?

Jeremiah thank you very much for the feedback (I didn't get an alert to a reply to my post so I've only just seen it now) but I will definitely give this a try and see how it works.

I've just tested your link http://test.anra.org/gyrotest and it works perfectly. No gyro buttons shown on PC using Chrome but view on iPhone and Gyro button appears and works! Thank you very much.

I've never edited my xml code before but I'll definitely be trying this. It would be nice if it was the default output from PTP with the iOS output selected or if I could create a custom theme/template that included this. I have a custom HTML template but IIRC you can't create an XML template?

Offline

 

#5 2011-12-05 20:32:00

Jeremiah
Member
Registered: 2011-10-31
Posts: 29

Re: Gyroscope on/off button?

It looks like you can create enough of an xml template for this purpose. They're in the templates folder under "menu".
If you wanted to fully integrate the function, you would have to make changes in the "themes" folder as well.
I will probably need to set some of this up for myself, and I would be happy to share, but it will most likely be after Christmas before I will have time.

Offline

 

#6 2011-12-05 23:30:28

scoopz
Member
Registered: 2011-11-28
Posts: 27

Re: Gyroscope on/off button?

Jeremiah wrote:

I will probably need to set some of this up for myself, and I would be happy to share, but it will most likely be after Christmas before I will have time.

That's very kind of you and I'd love it if you could share that with me. big_smile

Offline

 

#7 2011-12-21 18:48:05

Jeremiah
Member
Registered: 2011-10-31
Posts: 29

Re: Gyroscope on/off button?

Ok, I'm still not 100% happy with this, but it seems to be working. You do need to make sure you've activated the gyroscope plugin, and the iPhone viewer when generating the tour, or this may do something weird. I have not tested it.

files are in this zip: http://dl.dropbox.com/u/554596/ptp-gyro-template.zip

they need to be put into the templates folder like this:
http://dl.dropbox.com/u/554596/ptp-template-structure.png

Then just select the 2D-Gyro theme, and the Navigation + FullScreen + Rotation + Gyroscope control bar template.

Let me know if it works for you.

Thanks,
Jeremiah

Offline

 

#8 2012-04-11 15:32:10

graemefordham
Member
Registered: 2011-06-14
Posts: 31

Re: Gyroscope on/off button?

Hi there,

Jeremiah, thanks for the info so far, seems to be the only thread here on the subject. First time creating the gyro function and felt it would be obvious to have a enable/disable function. I downloaded your templates pack, just trying to locate where to add it in. I'm on a mac, tried to 'show contents' to put it in there, but no such folder. Where is the resources folder? Some help would be great thanks.

I wonder, in the end, did you manage to get it up and running well? The sample gyro tour is not there anymore. Thanks.

G

Offline

 

#9 2012-04-11 16:03:31

Jeremiah
Member
Registered: 2011-10-31
Posts: 29

Re: Gyroscope on/off button?

I'm still using the gyro button. You can see it on any of the monitoring sites here:
http://www.anra.org/divisions/water_qua … ing_sites/
The templates folder is accessible from within panotour under the edit menu.

Offline

 

#10 2012-04-11 18:37:13

mediavets
Moderator
From: Isleham, Cambridgeshire, UK.
Registered: 2007-11-14
Posts: 9730
Website

Re: Gyroscope on/off button?

Jeremiah wrote:

The templates folder is accessible from within panotour under the edit menu.

Here:


Uploaded Images


Andrew Stephens
Nikon D40, Nikkor 10.5mm fisheye, Sigma 8mm f3.5 fisheye, Nikkor 18-55/50/35mm lenses, Nodal Ninja 5 Lite, Nodal Ninja 4 with R-D16, Agno's MrotatorTCS short.
Nikon P5100, CP5000, CP995, FC-E8, WC-E63,WC-E68, TC-E2, Kaidan Kiwi 995, Bophoto pano bracket, Agno's MrotatorA.
Merlin/Orion robotic pano head + Papywizard on Nokia 770/N800/N810 and Windows 8/XP/2K.

Offline

 

#11 2012-04-25 13:07:33

graemefordham
Member
Registered: 2011-06-14
Posts: 31

Re: Gyroscope on/off button?

Hi there,

Thanks Jeremiah for your very swift reply and apologies for my very delayed thanks. Great, just opened PTP up and located it, thanks a bundle. The simplest things, sometimes!

Just had a look on the iPad with one of your examples and came up fine (you must have got a bit wet for some of them!). I'm sure PTP will include this feature soon. Makes sense. Good on you for developing it though. Again, many thanks.

Graeme

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson