You are not logged in.

1

Thursday, December 10th 2009, 10:36pm

Redefine coordinates?

Is there a way to set a new zero point of the coordinate system? I made two panoramas of the same room, before and after tidying up. They can be switched by clicking a button, but as they unfortunately have different zero points, the camera looks into another direction after changing the panorama. Realigning them in my stitching program would be very exhausting.
0100011101101100011001010110100101100011 0110100000100000011010110110110001100001 0111010001110011011000110110100001110100 0110010101110100001011000010000001001010 0111010101101110011001110110010100101110 0010000001000101011000110110100001110100 0010000001101010011001010111010001111010 0111010000101110

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Friday, December 11th 2009, 1:37am

Hi Dr. Schneckem,

Try setting a new view for your pano like this:

Source code

1
<view hlookat="0" vlookat="0" fov="100" />

Changes the value of each attributes to match your needs and make the 2 panos looking at the same point...

more info about the <view> node here: http://krpano.com/docu/xml/#view

SAlut.

3

Friday, December 11th 2009, 1:51pm

Hello michel,

This doesn't work, as I want to have the same view after changing the pano wherever the camera has looked before. You may want to have a look at the pano: http://kacken.bplaced.net/test/test.html

I used KEEPVIEW as onclick attribute, but after switching the view is displaced about 90°, as the zero points don't agree. If I for instance could set the zero points to the upper left corner of the door, I had much less work than realigning both panos and make them match perfectly.

Thank you anyway :)
0100011101101100011001010110100101100011 0110100000100000011010110110110001100001 0111010001110011011000110110100001110100 0110010101110100001011000010000001001010 0111010101101110011001110110010100101110 0010000001000101011000110110100001110100 0010000001101010011001010111010001111010 0111010000101110

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Friday, December 11th 2009, 6:22pm

Erased... send it two times... *blink*

This post has been edited 1 times, last edit by "michel" (Dec 11th 2009, 6:55pm)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

5

Friday, December 11th 2009, 6:23pm

Hi Dr. Schneckem,

Ok.. You need something more complicate ;-) ... So, I am going to try with the following code and try to explain *whistling* ..,

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.

6

Friday, December 11th 2009, 6:52pm

*love* Worked perfectly. Thank you very much.
0100011101101100011001010110100101100011 0110100000100000011010110110110001100001 0111010001110011011000110110100001110100 0110010101110100001011000010000001001010 0111010101101110011001110110010100101110 0010000001000101011000110110100001110100 0010000001101010011001010111010001111010 0111010000101110