Sie sind nicht angemeldet.

olihar

Schüler

  • »olihar« ist der Autor dieses Themas

Beiträge: 140

Wohnort: Iceland

Beruf: Interaction Designer

  • Nachricht senden

1

Dienstag, 21. September 2010, 07:44

Flat to Spherical browsing

Hi Gang

I have been thinking of trying to give some power to the user of browsing my pano's

Is it possible to create a button that turns a flat 360° pano like I have used to display in the past to a 360° spherical browsing.

From this
http://www.olihar.com/gallery/Panorama/U…112429R.txt.php
to this
http://www.olihar.com/gallery/Panorama/U…_sphere.txt.php

and then back to flat.

I have a test there next to the full screen button but I have not gotten anything to work, as I am not sure if something like this is possible to do unless you load 2 different xml files, I would love to try and not do that.

One of the tries I assigned this to the button.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	<action name="flat">
	   	 
	   	 set(view.hfov,2.3792);
	   	 set(view.vfov,1.1896);
	   	 set(view.limitview,fullrange);
	   	 
	</action>
	
	<action name="sphere">
	    
	    set(view.hfov,360);
	    set(view.vfov,180);
	    set(view.limitview,range);
	
	</action> 


Any ideas how this can be done...?

Thanks...

2

Dienstag, 21. September 2010, 13:54

Hi,

at the moment that's not possible,
but in the next release I have extended the 'updateobject()' action to re-parse also the "image.hfov" and "image.vfov" settings,
then it would be possible to change dynamically the hfov of the pano image,

best regards,
Klaus

olihar

Schüler

  • »olihar« ist der Autor dieses Themas

Beiträge: 140

Wohnort: Iceland

Beruf: Interaction Designer

  • Nachricht senden

3

Dienstag, 21. September 2010, 17:45

When can that be expected? are you talking about the next beta or the next big release?

Do you have a suggestion for a workaround for now?

It would be so great as well if the button I will make could read from the file giving it the needed values for changing to spherical view, let say for images that are not 360°.

So the button would pull the values out of the html file for each image as they will have different values, for flat and spherical, if you follow my drift

4

Mittwoch, 22. September 2010, 02:07

Hi Olihar,

I have played around your request and finally I got this code (using sphere type):

Quellcode

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
65
66
<krpano onstart="" >

	<view fovtype="hfov" fov="1" limitview="fullrange" fovmax="130" maxpixelzoom="2.0" />
	<control zoomtocursor="true" zoomoutcursor="false" />

	<image type="sphere" hfov="1.00" multires="true" tilesize="512">
		<level tiledimagewidth="6284" tiledimageheight="3142">
			<sphere url="cube_sphere.tiles/l4/%0v_%0h.jpg" />
		</level>
		<level tiledimagewidth="3142" tiledimageheight="1571">
			<sphere url="cube_sphere.tiles/l3/%0v_%0h.jpg" />
		</level>
		<level tiledimagewidth="1571" tiledimageheight="786">
			<sphere url="cube_sphere.tiles/l2/%0v_%0h.jpg" />
		</level>
		<level tiledimagewidth="786" tiledimageheight="393">
			<sphere url="cube_sphere.tiles/l1/%0v_%0h.jpg" />
		</level>
	</image>
	
	<action name="do_flat_to_360" >
		set(image.hfov,360);
		set(image.vfov,180);
		mul(view.fov,360);
		mul(view.hlookat,360);
		mul(view.vlookat,360);
		reloadpano();
		wait(load);
	</action>
	
	<action name="do_360_to_flat" >
		set(image.hfov,1);
		set(image.vfov,0.5);
		copy(tempfov,view.fov);
		adjusthlookat(view.hlookat);
		if(view.hlookat GT 180,sub(view.hlookat,360));
		if(view.hlookat LT -180,add(view.hlookat,360));
		copy(temphlookat,view.hlookat);
		copy(tempvlookat,view.vlookat);
		reloadpano();
		wait(load);
		div(view.fov,tempfov,360);
		div(view.hlookat,temphlookat,360);
		div(view.vlookat,tempvlookat,360);
	</action>

	<style name="buttonstyle"
	   	url="%SWFPATH%/plugins/textfield.swf" children="false"
	   	width="130" 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);"
	   	/>

	<plugin name="bt" keep="true" style="buttonstyle"
	    	html="[p]do_flat_to_360[/p]"
	    	align="top" x="0" y="0"
			click_A="set(html,[p]do_360_to_flat[/p]);set(plugin[bt].onclick,click_B());freezeview(true);do_flat_to_360();wait(load);freezeview(false);"
			click_B="set(html,[p]do_flat_to_360[/p]);set(plugin[bt].onclick,click_A());freezeview(true);do_360_to_flat();wait(load);freezeview(false);"
	    	onclick="click_A();"
	    	/>

</krpano>


Hope this can be useful...

SAlut.

olihar

Schüler

  • »olihar« ist der Autor dieses Themas

Beiträge: 140

Wohnort: Iceland

Beruf: Interaction Designer

  • Nachricht senden

5

Donnerstag, 23. September 2010, 02:38

Fantastic, tiny modifications and this seems to work like a charm...

Have a look here and tell me what you guys think and see if it works.

http://www.olihar.com/gallery/Panorama/U…112429R.txt.php

Thanks again for your suggestion... Hopefully what Klaus has in mind does it a little bit more on the fly instead of the little delay... As well it would be fantastic to be able to do this with partial panos as well, by pulling info from the zoomify xml file for example and assign the fov that way...

Again thanks a lot and please tell me how it works on your system...

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »olihar« (23. September 2010, 03:16)


6

Donnerstag, 23. September 2010, 03:36

nice, very nice! i can see where this can come in handy. great idea Olihar and excellent coding as usual Michel

Ähnliche Themen