You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 125

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

1

Friday, March 9th 2012, 1:34pm

Gyro trouble

Since I don't have an Ipad 2 or Iphone4, it's difficult for me to find a solution. A client is complaining that, when he use the gyro, everything goes fine, but when he turns of gyro, uses the pano by hand and then reenables the gyro, oriention is completely lost. Does anyone knows a solution? This is the code...
Thanks for help,
Yvan.


Source code

1
2
3
		<plugin name="gyro" url="gyro.js" enabled="true" camroll="true" friction="0.5" velastic="0.2" devices="html5" keep="true"		onloaded="delayedcall(1,if(available, set(plugin[gyro-button].visible,true);));"		/>				<plugin name="gyro-button" url="gyro.js" enabled="true" camroll="true" friction="0.5" velastic="0.2" devices="html5" keep="true"			visible="false"		/>
		<action name="activateGyro" devices="iphone|tablet|mobile|android">			moveto(0,0);			delayedcall(1,set(plugin[gyro-button].enabled, true));			delayedcall(1,set(plugin[gyro].enabled, true));			set(plugin[btn_gyroOn].visible,true);			set(plugin[btn_gyroOff].visible,false);		</action>
		<action name="deActivateGyro" devices="iphone|tablet|mobile|android">			set(plugin[gyro-button].enabled, false);			set(plugin[gyro].enabled, false);			set(plugin[btn_gyroOn].visible,false);			set(plugin[btn_gyroOff].visible,true);		</action>
</plugin></plugin>

This post has been edited 2 times, last edit by "Birdseye" (Mar 9th 2012, 5:19pm)


Tuur

Sage

Posts: 3,822

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Friday, March 9th 2012, 3:42pm

maybe take that moveto 0,0 out?!

Hope it helps!

i use:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<plugin name="gyroscope" 
        url="../skin/gyro.js" 
        keep="true"
        enabled="true"
        camroll="false"
        friction="0.5"
        velastic="0"
/>



<plugin name="gyro" 
        url="../skin/buttons/btn_gyro.png"  
        visible="false" 
        zorder="100"  
        keep="true" 
        scale="2"  
        align="rightbottom" 
        x="-10" 
        y="240"  
        ondown="switch(plugin[gyroscope].enabled);" 
/>


Tuur *thumbsup*

Ps Please try to publish your code in an vertical way. This is almost unreadable in the forum.

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 125

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

3

Friday, March 9th 2012, 5:15pm

Thank you for the help Tuur.
The move to 0,0 was a tryout to recalibrate the 360. But obviously it didn't work.

Sorry about the horizontal code :( each time I paste the vertical code, it automaticly positions horizontal.

4

Friday, March 9th 2012, 8:41pm

I think this is what you are wanting. The camroll option listed here when you disable the gyro.

Info text box not showing in iPhone/iPad

Edit: set(view.camroll,0.0);

I found that you could get stuck with the angle you were holding the phone if you simply turned off the gyro. I added that in and it seemed to fix the problem although using the set made it "jump" to straighten out. I would assume a tween would be more gentle but I have not tested it that way. I don't use the gyro and posted that code to help someone else.

This post has been edited 1 times, last edit by "Jarredja" (Mar 12th 2012, 12:06pm)


5

Monday, March 12th 2012, 10:13am

Hi,

when disabling the gyro also do:

Source code

1
tween(view.camroll,0);

then the camroll will animate smoothly back to start,

best regards,
Klaus

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 125

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

6

Wednesday, March 14th 2012, 6:24am

Thank you for all the help.

Tuur

Sage

Posts: 3,822

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Saturday, June 9th 2012, 12:39pm

Hi,

is there a way to get the percentage or even better amount of degrees of the camroll?

i like to show that aswell in my krpano 'Tool' ;)

http://virtualtuur.com/krpano/compass/

i also find that the compass direction is changing when you change the device diagonaly,, so when camroll kicks in..
is there some math involved? so that it keeps north when you 'camroll' your device??

I also find that when i go from level to compas or vise versa i have to touch the screen before it 'resets'...
Is there a solution?

And it's a bit stuttering sometimes.. what could that be??
Tuur *thumbsup*

This post has been edited 3 times, last edit by "Tuur" (Jun 11th 2012, 10:42am)


8

Tuesday, August 28th 2012, 5:19am

Biggest problem I see with the air compass, it's all you want to look at. Forget the tour.
Bill



http://astimegoesby.us Personal family history back to the 1800's

9

Tuesday, October 16th 2012, 4:27pm

I need the loading/starting pano to look north if I point the iPhone/iPad in north-direction. same for any other direction.
is there any way gyro.js can manage that?

Tuur

Sage

Posts: 3,822

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

Similar threads