I just replaced all my krpano files and now it seems to work. I was sure they all were up to date but apparently they were not. Thanks for your help and sorry for the trouble.
iphone4 gyroscope plugin
-
-
Thx for the Gyro-Support. Works perfect!
I got the Problem, that when i put the iPad on a table it always shows the Nadir of my panorama and that is ugly.
Is there any possible solution that the gyro works only at s certain degree? Or when the gyro doesn't move, it shows a defined view.
Would be nice.Thanks for the good work!
Greets.
-
You should be able to turn it off yourself and move the view back level using events and the view variables.
-
-
Since the gyro plugin is now a "proper" plugin, there is no longer a global "gyro" object. Instead you access its properties like any other object.
So if you use this to include the plugin in your xml...
...you would use this from your js: -
I am total novice, can't figure out how to make gyro.js plugin to work, please help! What I understand from reading posts in this thread, that I need to place the following code:
Code<plugin name="gyro" url="gyro.js" keep="true" enabled="true" camroll="false" friction="0.5" velastic="0" />
Question is, where does it go? Inside the html document or the xml document? Also where in the document does it go (after what code, before what code should I place the above code)?
"gyro.js" plugin is in the root directory of the pano, along with the html, xml and the pano.swf files.
Thanks in advance
-
it goes in the xml anywhere inside the krpano tags. <krpano> </krpano> if you are using the vtour droplet and have scenes be sure it is not inside the scenes. use keep="true" and you are good to go.
-
Hi VN2011, thanks for replying
I did what you said, iserted the code just before </krpano>. when I try in my iPad2 it says
"ERROR: plugin[gyro] loading error: gyro.js
I am using latest version of krpanotools (krpanotools-1.0.8.12-mac64-2010-11-24) and gyro.js (creation date June 2nd, 2011)
any idea?
-
then your file path is wrong. if the url is gyro.js then make sure that file is in the same place as krpano.swf
-
Here is my folder structure:
and here is the xml:
Code
Display More<krpano version="1.0.8" onstart="startup();"> <!-- vtour.xml template krpano tools version 1.0.8.12 --> <plugin name="gyro" url="gyro.js" keep="true" enabled="true" camroll="false" friction="0.5" velastic="0" /> <action name="startup"> <!-- load the first scene --> loadscene(get(scene[0].name), null, MERGE); <!-- build the thumbnails (remove the next line to remove the thumbnails) --> buildthumbs(); </action> <!-- disable the default progress bar --> <progress showload="none" showwait="none" /> <!-- hotspot styles (for Flash and HTML5) --> <style name="hotspot_ani_black" url="hotspots/hotspot_ani_black_64x64x20.png" crop="0|0|64|64" frames="20" framewidth="64" frameheight="64" frame="0" onloaded="hotspot_animate();" altonloaded="if(isphone, mul(scale,2)); onloaded();" /> <style name="hotspot_ani_white" url="hotspots/hotspot_ani_white_64x64x20.png" crop="0|0|64|64" frames="20" framewidth="64" frameheight="64" frame="0" onloaded="hotspot_animate();" altonloaded="if(isphone, mul(scale,2)); onloaded();" /> <action name="hotspot_animate"> inc(frame,1,get(frames),0); mul(ypos,frame,frameheight); txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight)); delayedcall(0.03, hotspot_animate() ); </action> <scene name="scene_deck" title="deck" onstart="" thumburl="deck.tiles/thumb.jpg"> <view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" /> <preview url="deck.tiles/preview.jpg" /> <image> <left url="deck.tiles/pano_l.jpg" /> <front url="deck.tiles/pano_f.jpg" /> <right url="deck.tiles/pano_r.jpg" /> <back url="deck.tiles/pano_b.jpg" /> <up url="deck.tiles/pano_u.jpg" /> <down url="deck.tiles/pano_d.jpg" /> <mobile> <left url="deck.tiles/mobile_l.jpg" /> <front url="deck.tiles/mobile_f.jpg" /> <right url="deck.tiles/mobile_r.jpg" /> <back url="deck.tiles/mobile_b.jpg" /> <up url="deck.tiles/mobile_u.jpg" /> <down url="deck.tiles/mobile_d.jpg" /> </mobile> <tablet> <left url="deck.tiles/tablet_l.jpg" /> <front url="deck.tiles/tablet_f.jpg" /> <right url="deck.tiles/tablet_r.jpg" /> <back url="deck.tiles/tablet_b.jpg" /> <up url="deck.tiles/tablet_u.jpg" /> <down url="deck.tiles/tablet_d.jpg" /> </tablet> </image> <!-- place hotspots here --> <!-- example hotspot: --> <hotspot name="spot1" style="hotspot_ani_black" ath="0" atv="0" zoom="false" onclick="looktohotspot(get(name)); loadscene('scene_home',null,MERGE,BLEND(1));" /> </scene> <scene name="scene_home" title="home" onstart="" thumburl="home.tiles/thumb.jpg"> <view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" /> <preview url="home.tiles/preview.jpg" /> <image> <left url="home.tiles/pano_l.jpg" /> <front url="home.tiles/pano_f.jpg" /> <right url="home.tiles/pano_r.jpg" /> <back url="home.tiles/pano_b.jpg" /> <up url="home.tiles/pano_u.jpg" /> <down url="home.tiles/pano_d.jpg" /> <mobile> <left url="home.tiles/mobile_l.jpg" /> <front url="home.tiles/mobile_f.jpg" /> <right url="home.tiles/mobile_r.jpg" /> <back url="home.tiles/mobile_b.jpg" /> <up url="home.tiles/mobile_u.jpg" /> <down url="home.tiles/mobile_d.jpg" /> </mobile> <tablet> <left url="home.tiles/tablet_l.jpg" /> <front url="home.tiles/tablet_f.jpg" /> <right url="home.tiles/tablet_r.jpg" /> <back url="home.tiles/tablet_b.jpg" /> <up url="home.tiles/tablet_u.jpg" /> <down url="home.tiles/tablet_d.jpg" /> </tablet> </image> <!-- place hotspots here --> <!-- example hotspot: --> <hotspot name="spot1" style="hotspot_ani_black" ath="0" atv="0" zoom="false" onclick="looktohotspot(get(name)); loadscene('scene_deck',null,MERGE,BLEND(1));" /> </scene> <!-- thumbnail actions begin (remove the 'buildthumbs()' call in the onstart event to remove the thumbs) --> <action name="buildthumbs"> if(%1 != NEXT, set(i,0)); if(i LT scene.count, copy(thumb, scene[get(i)].thumburl); txtadd(thumbname,'thumb_',get(i)); addplugin(get(thumbname)); set(plugin[get(thumbname)].url, get(thumb)); set(plugin[get(thumbname)].keep, true); set(plugin[get(thumbname)].align, leftbottom); set(plugin[get(thumbname)].width, 40); set(plugin[get(thumbname)].height, 40); set(plugin[get(thumbname)].x, 10); set(plugin[get(thumbname)].y, 10); mul(plugin[get(thumbname)].x, i,3); mul(plugin[get(thumbname)].y, i,3); add(plugin[get(thumbname)].x, 5); add(plugin[get(thumbname)].y, 5); copy(plugin[get(thumbname)].xsmall, plugin[get(thumbname)].x); copy(plugin[get(thumbname)].ysmall, plugin[get(thumbname)].y); add(plugin[get(thumbname)].zorder, 100, i); set(plugin[get(thumbname)].effect,glow(0xFFFFFF,1.0,2,10000)); set(plugin[get(thumbname)].jsborder,'1px solid #FFFFFF'); copy(plugin[get(thumbname)].thumbpos, i); set(plugin[get(thumbname)].linkedscene, get(scene[get(i)].name) ); set(plugin[get(thumbname)].onclick, openthumbs() ); inc(i); buildthumbs(NEXT); ); </action> <action name="openthumb"> if(%2 != NEXT, set(pos,0); copy(curpos, plugin[%1].thumbpos); set(xdst, 0); set(ydst, 0); ); if(pos LT curpos, inc(pos); inc(ydst,90); sub(ymax, stageheight, 100); if(ydst GT ymax, inc(xdst,90);set(ydst,0); ); openthumb(%1,NEXT); , add(xdst,10); add(ydst,10); tween(plugin[%1].x, get(xdst) ); tween(plugin[%1].y, get(ydst) ); tween(plugin[%1].width, 80); tween(plugin[%1].height, 80); ); </action> <action name="closethumb"> tween(plugin[%1].x, get(plugin[%1].xsmall)); tween(plugin[%1].y, get(plugin[%1].ysmall)); tween(plugin[%1].width, 40); tween(plugin[%1].height, 40); </action> <action name="openthumbs"> if(%1 != NEXT, set(i,0); set(events.onclick, set(events.onclick,null); delayedcall(0.1, closethumbs() ); ); ); if(i LT scene.count, txtadd(thumbname,'thumb_',get(i)); openthumb(get(thumbname)); set(plugin[get(thumbname)].onclick, set(events.onclick,null); closethumbs(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); ); inc(i); openthumbs(NEXT); ); </action> <action name="closethumbs"> if(%1 != NEXT, set(i,0)); if(i LT scene.count, txtadd(thumbname,'thumb_',get(i)); closethumb(get(thumbname)); set(plugin[get(thumbname)].onclick, openthumbs() ); inc(i); closethumbs(NEXT); ); </action> <!-- thumbnail actions end --> </krpano>
But it is not working!!!
Please help!
TIA
-
Hi,
I am using latest version of krpanotools (krpanotools-1.0.8.12-mac64-2010-11-24) and gyro.js (creation date June 2nd, 2011)
you need to use at least a 1.0.8.14 version,
the Javascript Plugin interface was introduced there,get the latest here:
https://krpano.com/download/beta/best regards,
Klaus -
Klaus, thanks for the heads up! It works now!!
-
any way to disable moving the pano with your finger (overriding the gyro control)??
-
-
To my surprise, I got the gyro plugin working without much trouble, on some suitably strange architecture!
http://www.john-law.net/projects/giro/
Thanks Aldo
JL
-
I tried to put this in the XML, but did not work. Do i need to change the gyro.JS file?
<plugin name="gyro" url="gyro.js" keep="true" enabled="true" camroll="true" friction="0.5" velastic="0.2" control usercontrol="off"/>
<plugin name="gyro" url="gyro.js" keep="true" enabled="true" camroll="true" friction="0.5" velastic="0.2" usercontrol="off"/> -
Hi,
the usercontrol setting is a krpano setting,
see here:
https://krpano.com/docu/xml/#control.advancedthat means just add that line to the xml:
and when calling other panos the MERGE or KEEPCONTROL flags should be used to avoid that this setting will be set back to default,best regards,
Klaus -
works great, now my next wall is getting a hotspot to activate no user control.
I have failed on getting this to function.
Thanks for the help you all!
-Zack
I got it, for anyone interested.
onclick="set(control.usercontrol,off)"
-
cannot get the available property.
plugin[gyro].available always to null on start
is it a bug?
-
It may help to add preload="true" to the plugin.
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!