Hi,
here a quick and fully automatic solution for simple 3d transitions:
https://krpano.com/examples/simple3dtransition/
The xml:
https://krpano.com/viewsource.html?examp…sition/tour.xml
That's a default krpano VTOUR with the default hotspots, the only thing that is modified is this hotspot click action from the vtourskin.xml.
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<action name="skin_hotspotstyle_click" scope="local">
if(caller.linkedscene,
copy(hs_linkedscene, caller.linkedscene);
if(caller.linkedscene_lookat, txtsplit(caller.linkedscene_lookat, ',', hs_lookat_h, hs_lookat_v, hs_lookat_fov); );
set(caller.enabled, false);
skin_hidetooltips();
spheretospace(caller.ath,caller.atv,caller.depth, tx,ty,tz);
set(s, -0.5);
tween(image.ox|image.oy|image.oz|caller.alpha, calc((s*tx)+'|'+(s*ty)+'|'+(s*tz)+'|0'), 0.5, default,
skin_loadscene(get(hs_linkedscene), get(skin_settings.loadscene_blend));
set(view.oz, 500);
tween(view.oz, 0);
if(hs_lookat_h !== null, skin_lookat(get(hs_lookat_h), get(hs_lookat_v), get(hs_lookat_fov)); );
skin_updatescroll();
);
);
</action>
|
It can either changed in the vtourskin.xml or redefined in the tour.xml.
That should look like in your example - moving toward the hotspot position and in the new scene a moving-in animation.
But because there is no depth-geometry the resulting distortions are depending on the image-content and how it is aligned to the cube-faces.
About the code:
1. this line converts the hotspots ath/atv position to a 3D position:
|
Quellcode
|
1
|
spheretospace(caller.ath,caller.atv,caller.depth, tx,ty,tz);
|
2. then this code moves the pano 3D position half-way into the opposite direction:
|
Quellcode
|
1
2
|
set(s, -0.5);
tween(image.ox|image.oy|image.oz|caller.alpha, calc((s*tx)+'|'+(s*ty)+'|'+(s*tz)+'|0')
|
opposite direction by the negative scale value and because the pano itself will be moved and not the view
3. after loading the next scene the view.oz value will set to 500 to move the view a bit outwards and then tweened back to 0 as moving animation.
|
Quellcode
|
1
2
|
set(view.oz, 500);
tween(view.oz, 0);
|
The remaining code of that action is the default one from the vtourskin.xml.
Instead of step 3 it would be also possible to use the moving direction toward the hotspot also as moving-in direction in the next scene. But therefore the scenes should be aligned together (e.g. same north in all panos) and the KEEPVIEW flag be used:
|
Quellcode
|
1
2
|
set(image, ox=calc(tx), oy=calc(ty), oz=calc(tz));
tween(image.ox|image.oy|image.oz, 0|0|0, 0.5, default);
|
Here the example from above with that modification:
https://krpano.com/examples/simple3dtransition/example2.html
The xml:
https://krpano.com/viewsource.html?examp…ition/tour2.xml
Best regards,
Klaus