Hi,
i have sort of strange and difficult compass / map / aircompass / heading problem.
i try to explain.
I made a barebone example ONLY FOR IPAD:
http://www.virtualtuur.com/krpano/compasstest2/
so have a look, 3 pano's, radar on map is correct!
aircompass is pointing to the right, real world, north in the first pano. But the photo is off. It points to hlookat 0.
So... The photo and radar are right, to each other. The compass and aircompss are right to the real world.
Easy you just say? Inthe next photo the deviation is different because of the zero of the photo.
When i change heading, the radar is off...
when i put 'header 180' the north on aircompass is right (real north) but not in the pano and radar. it's off.
i played with numbers but can't get it.
Also for the next pano's ths problem is even worse (same).
So the north of the compass is not the 'north' (hlookat 0) of the photo.
- when i put aircompass to the right point (north) in the photo, the absolute north is off
- when i put aircompass to the right realworld north, the photo is off
-so is there a deviation option in the compass plugin?
-or how can i set a new header for each photo? (not sure if that makes sence)
-can i change the photo hlookat just for aircompass. So aircompass thinks it's 0?
as i didn't stitch with the north in the center these problems occure.
problem 2 :
when you put compass button and gyro button, so that they are both of. Then activate the gyro. all is fine.. but when you activate compass the gyro stops...
edit;
now i put the radar and the aircompass and the pano in the rigth possition. But still the compass.js takes a real north.
here full code:
<krpano logkey="true" onstart="startup();map_vars();" >
<include url="vtourskin.xml" />
<include url="actions_move_mobile.xml" />
<include url="map.xml" />
<include url="vars.xml" />
<include url="compass.xml" />
<action name="startup">
if(startscene === null, copy(startscene,scene[0].name));
loadscene(get(startscene), null, MERGE);
</action>
<scene name="scene_huis_1" title="1" onstart="setmapspots();" thumburl="panos/huis_1.tiles/thumb.jpg" heading="55">
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="70" maxpixelzoom="2.0" fovmin="30" fovmax="120" limitview="auto" />
<include url="aircompass/aircompass.xml" />
<preview url="../../../vosbergen/mobile/panos/huis_1.tiles/preview.jpg" />
<image>
<cube url="../../../vosbergen/mobile/panos/huis_1.tiles/pano_%s.jpg" />
<mobile>
<cube url="../../../vosbergen/mobile/panos/huis_1.tiles/mobile_%s.jpg" />
</mobile>
</image>
<hotspot name="hs1" style="skin_hotspotstyle_black" ath="35.821" atv="6.382" linkedscene="scene_vos_2" />
</scene>
<scene name="scene_vos_2" title="2" onstart="setmapspots();" thumburl="panos/vos_2.tiles/thumb.jpg" lat="" lng="" heading="">
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="70" maxpixelzoom="2.0" fovmin="30" fovmax="120" limitview="auto" />
<include url="aircompass/aircompass.xml" />
<preview url="../../../vosbergen/mobile/panos/vos_2.tiles/preview.jpg" />
<image>
<cube url="../../../vosbergen/mobile/panos/vos_2.tiles/pano_%s.jpg" />
<mobile>
<cube url="../../../vosbergen/mobile/panos/vos_2.tiles/mobile_%s.jpg" />
</mobile>
</image>
<hotspot name="hs2" style="skin_hotspotstyle_black" ath="0.5567018186254984" atv="15.731434768064597" linkedscene="scene_huis_1" />
<hotspot name="hs2_2" style="skin_hotspotstyle_black" ath="180" atv="15.731434768064597" linkedscene="scene_vos_3" />
</scene>
<scene name="scene_vos_3" title="3" onstart="setmapspots();" thumburl="panos/vos_3.tiles/thumb.jpg" lat="" lng="" heading="">
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="70" maxpixelzoom="2.0" fovmin="30" fovmax="120" limitview="auto" />
<include url="aircompass/aircompass.xml" />
<preview url="../../../vosbergen/mobile/panos/vos_3.tiles/preview.jpg" />
<image>
<cube url="../../../vosbergen/mobile/panos/vos_3.tiles/pano_%s.jpg" />
<mobile>
<cube url="../../../vosbergen/mobile/panos/vos_3.tiles/mobile_%s.jpg" />
</mobile>
</image>
<hotspot name="hs3_2" style="skin_hotspotstyle_black" ath="-1.1425375474639026" atv="13" linkedscene="scene_vos_2" />
</scene>
<include url="aircompass/aircompass.xml" />
<plugin name="skin_gyro"
url="../skin/plugins/gyro.js"
keep="true"
enabled="true"
camroll="true"
friction="0.5"
velastic="0"
devices="mobile|tablet"
/>
<plugin name="compass" devices="html5"
url="../skin/plugins/compass.js"
compassenabled="true"
keep="true"
heading="50"
onavailability="if(compassenabled == true, copy(view.hlookat, heading););"
onchange="if(compassenabled == true, copy(view.hlookat, heading););"
/>
<evens name="compass" keep="true" onnewpano="if(plugin[compass].available, copy(view.hlookat, heading));" />
<style name="spot_style" url="../skin/buttons/mappoint2.png" keep="true" zorder="50" />
<action name="setmapspots">
map_vars();
txtadd(mapsptsx, '_spot', get(scene[get(xml.scene)].title), 'x');
copy(mapsptsx, get(mapsptsx));
txtadd(mapsptsy, '_spot', get(scene[get(xml.scene)].title), 'y');
copy(mapsptsy, get(mapsptsy));
txtadd(mapsptsh, '_spot', get(scene[get(xml.scene)].title), 'h');
copy(mapsptsh, get(mapsptsh));
set(plugin[spotx].x, get(mapsptsx));
set(plugin[spotx].y, get(mapsptsy));
add(mapsptsxm, mapsptsx,7);
add(mapsptsym, mapsptsy,7);
set(plugin[radar].x, get(mapsptsxm));
set(plugin[radar].y, get(mapsptsym));
set(plugin[radar].heading, get(mapsptsh));
</action>
<layer name="map" url="../skin/buttons/map_sat.png" scale="0.5" keep="true" align="lefttop" x="10" y="10" visible="true" >
<layer name="radar" url="../skin/plugins/radar.js" parent="map" zorder="5" origin="lefttop" edge="center" keep="true" scale="1.8" x="get(_spot1x);" y="get(_spot1y);" width="80" height="80" linewidth="2" fillalpha="0.5" fillcolor="0x000000" />
<layer name="spotx" url="../skin/buttons/mappointactive3.png" parent="map" visible="true" keep="true" zorder="100" origin="lefttop" x="get(_spot1x);" y="get(_spot1y);" />
<layer name="spot1" style="spot_style" x="get(_spot1x)" y="get(_spot1x)" onclick="loadscene(scene_huis_1),null,MERGE,BLEND(1));" onloaded="set(x,get(_spot1x));set(y,get(_spot1y));" />
<layer name="spot2" style="spot_style" x="get(_spot2x)" y="get(_spot2x)" onclick="loadscene(scene_vos_2),null,MERGE,BLEND(1));" onloaded="set(x,get(_spot2x));set(y,get(_spot2y));" />
<layer name="spot3" style="spot_style" x="get(_spot3x)" y="get(_spot3x)" onclick="loadscene(scene_vos_3),null,MERGE,BLEND(1));" onloaded="set(x,get(_spot3x));set(y,get(_spot3y));" />
</layer>
<action name="map_vars">
set(_spot1x, 212);
set(_spot1y, 149);
set(_spot1h, 198);
set(_spot2x, 180);
set(_spot2y, 146);
set(_spot2h, 20);
set(_spot3x, 160);
set(_spot3y, 138);
set(_spot3h, 15);
</action>
<progress showload="none" showwait="none" />
<!-- Skin Layout -->
<layer name="skin_btn_compass" url="../skin/buttons/btn_compass.png" keep="true" align="bottom" devices="HTML5" visible="true" x="-100" scale="0.5" ondown="if(plugin[compass].compassenabled == true, set(plugin[compass].compassenabled,false);set(plugin[skin_gyro].enabled,false);, set(plugin[compass].compassenabled,true);set(plugin[skin_gyro].enabled,true); );" />
<layer name="skin_btn_gyro" url="../skin/buttons/btn_gyro.png" keep="true" align="bottom" visible="true" devices="HTML5" x="140" scale="0.5" ondown="switch(plugin[skin_gyro].enabled);" />
<!-- Skin Hotspot Style (the hotspots need a 'linkedscene' attribute to be clickable)-->
<style name="skin_hotspotstyle_black" url="../skin/buttons/htsp_black.png" id="hotsp" alpha="0.6" scale="1" edge="top" oy="0" zoom="false" distorted="true" onclick=" setmovevar(); if(linkedscene, tween(scale,0.25,0.5); tween(oy,-50,0.5); tween(alpha,0,0.5,,WAIT); tween(view.vlookat,0,0.5, easeOutQuad); tween(view.fov,40,0.5, easeOutQuad); wait(1); loadscene(get(linkedscene),null,MERGE,BLEND(1)); ); wait(0.3); getmovevar(); " />
<action name="lookinterrupt">
breakall();
</action>
<action name="setmovevar">
set(_movevar, get(scene[get(xml.scene)].title));
</action>
<action name="getmovevar">
set(_newmovevar, get(scene[get(xml.scene)].title));
if(_movevar == 1,
if(_newmovevar == 2, lookat(0,0);wait(1);oninterrupt( action(lookinterrupt) );lookto(180,0,70,smooth(25,25,25)); );
);
if(_movevar == 2,
if(_newmovevar == 1, lookat(20,0);wait(1);oninterrupt( action(lookinterrupt) );lookto(270,0,70,smooth(25,25,25)); );
if(_newmovevar == 3, lookat(0,0);wait(1);oninterrupt( action(lookinterrupt) );lookto(270,0,70,smooth(25,25,25)); );
);
if(_movevar == 3,
if(_newmovevar == 2, lookat(180,0);wait(1);oninterrupt( action(lookinterrupt) );lookto(0,0,70,smooth(25,25,25)); );
);
</action>
</krpano>
Display More
Tuur