|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<krpano> <image type="CUBE" multires="true" tilesize="512" progressive="false"> <level tiledimagewidth="3183" tiledimageheight="3183"> <cube url="panos/IMG_9644_Panorama.tiles/l3_%s_%v_%h.jpg" /> </level> <level tiledimagewidth="1536" tiledimageheight="1536"> <cube url="panos/IMG_9644_Panorama.tiles/l2_%s_%v_%h.jpg" /> </level> <level tiledimagewidth="768" tiledimageheight="768"> <cube url="panos/IMG_9644_Panorama.tiles/l1_%s_%v_%h.jpg" /> </level> <mobile> <cube url="panos/IMG_9644_Panorama.tiles/mobile_%s.jpg" /> </mobile> </image> <view hlookat="90" vlookat="15" fov="100"/> <!-- water hotspot hfov = 150 (values from PTGUI/Hugin) yaw = -90 pitch = -4 roll = -30 --> <hotspot name="water" url="2.jpg" distorted="true" onloaded="calc_pos_from_hfov_yaw_pitch_roll(49, -170, 0, 0); animation()" enabled="false" alpha="0.0" animation="sub(newalpha,1,alpha); tween(alpha,get(newalpha), 3.0, easeInSine, animation());"/> <!-- lower resolution images for HTML5 and mobile devices --> <hotspot name="water" url="pool_extract_html5desktop.jpg" devices="html5+desktop"/> <hotspot name="water" url="pool_extract_html5mobile.jpg" devices="mobile|tablet"/> <action name="calc_pos_from_hfov_yaw_pitch_roll"> div(hfov,%1,57.295779); div(yaw,%2,-57.295779); div(pitch,%3,57.295779); div(roll,%4,-57.295779); <!-- calc width --> mul(hfov,0.5); Math.tan(hfov); mul(width,hfov,1000); set(height,'prop'); <!-- calc ath,atv,rotate --> Math.cos(ch,yaw); Math.sin(sh,yaw); Math.cos(ca,pitch); Math.sin(sa,pitch); Math.cos(cb,roll); Math.sin(sb,roll); mul(m0,ca,ch); mul(tmp,cb,sa); mul(tmp,ch); mul(tmp2,sb,sh); add(m3,tmp,tmp2); mul(m4,cb,ca); mul(tmp,cb,sa); mul(tmp,sh); mul(tmp2,sb,ch); sub(m5n,tmp,tmp2); mul(m5n,-1); mul(tmp,sb,sa); mul(tmp,ch); mul(tmp2,cb,sh); sub(m6n,tmp,tmp2); mul(m6n,-1); Math.atan2(yaw,m6n,m0); Math.atan2(roll,m5n,m4); Math.asin(pitch,m3); mul(ath,yaw,57.295779); mul(atv,pitch,57.295779); mul(rotate,roll,57.295779); </action> </krpano> |
Either I'm missing some point or maybe there's some tricky thing in PT Gui...
got it working. It turns out that using |
|
Source code |
1 |
hfov="40" yaw="110.394" pitch="-14.4036" roll="18.1743" |
|
|
Source code |
1 |
hs_hfov="40" hs_yaw="110.394" hs_pitch="-14.4036" hs_roll="18.1743" |
Here a small tool tha can help to create the xml for animations
http://tools.view3.com/krpano_motion/
There are several ways you can go about this. Perhaps something that you could take a look at is this : http://krpano.com/examples/usage/#dragable-hotspots. This example lets you move hotspots with your mouse and gives you the ath and atv.Is there anyway to get the proper coordinates from panoramic 3d rendered image?
I already tried to align with scale, ath and atv, but getting it perfect is pretty difficult.
This post has been edited 1 times, last edit by "claire_france" (Oct 9th 2016, 11:28pm)
|
|
Source code |
1 2 3 4 5 6 |
<hotspot name="fridge-open" url.normal="fridge-open.jpg" distorted="true" onloaded="calc_pos_from_hfov_yaw_pitch_roll(122, 0, 0, 0);" visible="false" /> <action name="calc_pos_from_hfov_yaw_pitch_roll"> calc(deg2rad, Math.PI / 180.0); <!-- 计算热点尺寸 --> calc(hfov, 0.5 * (%1) * deg2rad); Math.tan(hfov); set(width, calc(hfov * 1000)); set(height, 'prop'); <!-- 计算球面坐标系和旋转设置 --> calc(yaw, -(%2) * deg2rad); calc(pitch, (%3) * deg2rad); calc(roll, -(%4) * deg2rad); Math.cos(ch, yaw); Math.sin(sh, yaw); Math.cos(ca, pitch); Math.sin(sa, pitch); Math.cos(cb, roll); Math.sin(sb, roll); Math.atan2(yaw, calc(cb*sh - sb*sa*ch), calc(ca*ch)); Math.atan2(roll, calc(sb*ch - cb*sa*sh), calc(cb*ca)); Math.asin(pitch, calc(cb*sa*ch + sb*sh)); calc(ath, yaw / deg2rad); calc(atv, pitch / deg2rad); calc(rotate, roll / deg2rad); </action> <hotspot name="hs1" alpha="0" depth="1000" polyline="false" scaleflying="true" tx="0" ty="0" tz="0" onclick="abc();" > <point ath="-19.853476" atv="-3.9391" /> <point ath="-19.326172" atv="35.578593" /> <point ath="20.01022" atv="34.117677" /> <point ath="19.731663" atv="-4.047307" /> </hotspot> <action name="abc"> if(hotspot[fridge-open].visible == true,set(hotspot[fridge-open].visible,false),set(hotspot[fridge-open].visible,true)); </action> |
Add depth="off" to the <hotspot>.But switching to WebVR I recognized a slight horizontal offset of some pixel of that hotspot image. Is this a known issue? Any workaround?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
<action name="trace_depth">
showlog();
trace('hs_depth %1 = ','get(hotspot[hs_depth_01].depth)' );
</action>
<scene name="scene_pano_01" title="Scene 01: Depth 2048" onstart="trace_depth(Scene 01);" thumburl="panos/pano.tiles/thumb.jpg" lat="" lng="" heading="">
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />
<preview url="panos/pano.tiles/preview.jpg" />
<image>
<cube url="panos/pano.tiles/pano_%s.jpg" />
<cube url="panos/pano.tiles/mobile/pano_%s.jpg" devices="mobile" />
</image>
<!-- place your scene hotspots here -->
<hotspot name="hs_depth_01"
url="skin/hs_depth.jpg"
distorted="true"
enabled="false"
depth="2048"
/>
</scene>
<scene name="scene_pano_02" title="Scene 02: Depth Off" onstart="trace_depth(Scene 02);" thumburl="panos/pano.tiles/thumb.jpg" lat="" lng="" heading="">
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />
<preview url="panos/pano.tiles/preview.jpg" />
<image>
<cube url="panos/pano.tiles/pano_%s.jpg" />
<cube url="panos/pano.tiles/mobile/pano_%s.jpg" devices="mobile" />
</image>
<!-- place your scene hotspots here -->
<hotspot name="hs_depth_01"
url="skin/hs_depth.jpg"
distorted="true"
enabled="false"
depth="off"
/>
</scene>
|
|
|
Source code |
1 2 3 4 5 |
<plugin name="WebVR" devices="html5" keep="true"
url="webvr.js"
worldscale="10.0"
...
/>
|