Hi Dr. Schneckem,
Ok.. You need something more complicate

... So, I am going to try with the following code and try to explain

..,
|
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<krpano version="1.0.8" onstart="action(onstart);" >
<!-- text styles for startup info -->
<textstyle name="infostyle" origin="top" edge="top" yoffset="10" textalign="center" background="false" border="false" fontsize="40" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="1.0" fadetime="1.0" />
<!-- start - load first scene -->
<action name="onstart">
loadscene(scene1, null, MERGE);
</action>
<action name="loadsceneX">
add(hlookat_X,get(view.hlookat),%2);
add(vlookat_X,get(view.vlookat),%3);
set(fov_X,get(view.fov));
loadscene(%1, null, MERGE, BLEND(1));
lookat(get(hlookat_X),get(vlookat_X),get(fov_X));
</action>
<style name="buttonstyle"
url="%SWFPATH%/plugins/textfield.swf" children="false"
width="120" height="22"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
visible="false"
onover="tween(alpha,0.7,distance(0.3,0.2));"
onout="tween(alpha,1.0,distance(0.3,0.2));"
onloaded="set(alpha,0);set(textblur,15);set(blur,15); set(visible,true); tween(alpha,1,0.3); tween(textblur,0,0.3); tween(blur,0,0.3);"
/>
<!-- first scene/pano -->
<scene name="scene1" onstart="showtext('[b][i]scene 1[/i][/b]', infostyle);">
<view hlookat="0" vlookat="0" fov="90" />
<image type="SPHERE">
<sphere url="garten.jpg" />
</image>
<plugin name="button" keep="false" style="buttonstyle"
html="[p]load scene 2[/p]"
align="bottom" x="0" y="25"
onclick="action(loadsceneX,scene2,127,0);"
/>
</scene>
<!-- second scene/pano-->
<scene name="scene2" onstart="showtext([b][i]scene 2[/i][/b], infostyle);">
<view hlookat="127" vlookat="0" fov="90" />
<image type="SPHERE">
<sphere url="garten1.jpg" />
</image>
<plugin name="button" keep="false" style="buttonstyle"
html="[p]load scene 1[/p]"
align="bottom" x="0" y="25"
onclick="action(loadsceneX,scene1,-127,0);"
/>
</scene>
</krpano>
|
So, you have two panos of the same place but with an horizontal offset between them. (note: this can be corrected from your stitcher or your painter programs.. But let say you can not).
We must know the offset value to correct it, and when loading the next pano we must retrieve the actual view to be able to pass this view to the next pano...
The code above has 2 scenes.
Each scene call an action when onclick the button...
the action loadsceneX has 3 parameters to be passed: action(loadsceneX,%1,%2,%3);
%1 = the scene name to be loaded
%2 = the horizontal offset between the actual scene and the next scene
%3 = the vertical offset between the actual scene and the next scene (this is not needed in your example..but here it is..)
in your example, you have an horizontal offset of about 90º and no vertical offset...
so the action from the scene1 will be:
|
Source code
|
1
|
action(loadsceneX,scene2,90,0);
|
and the action from the scene2 will be:
|
Source code
|
1
|
action(loadsceneX,scene1,-90,0);
|
Here is the action:
|
Source code
|
1
2
3
4
5
6
7
|
<action name="loadsceneX">
add(hlookat_X,get(view.hlookat),%2);
add(vlookat_X,get(view.vlookat),%3);
set(fov_X,get(view.fov));
loadscene(%1, null, MERGE, BLEND(1));
lookat(get(hlookat_X),get(vlookat_X),get(fov_X));
</action>
|
What it do:
line 2: -- set a new variable
hlookat_X to get the corrected value for the next hlookat...
hlookat_X = actual horizontal view + horizontal offset);
line 3: -- set a new variable
vlookat_X to get the corrected value for the next vlookat...
vlookat_X = actual vertical view + vertical offset
line 4: -- set a new variable
fov_X to get the actual fov...
fov_X = actual fov view
line 5: -- Load the given scene name
line 6: -- look at the same view as before
I have tried this way and it worked.
Hope this can help.
SAlut.