You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Yomas

Intermediate

  • "Yomas" started this thread

Posts: 190

Location: Anglet, France

  • Send private message

1

Friday, July 22nd 2011, 7:15pm

Updating my website and drying code help needed ^^

Hi all ^^
I'm making a V2 of my website and I want to make clearer the way I embed my panos in it.
Actually each tour I have in demo has it's own tour.swf and swfkrpano.js, and is embeded has follow:

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
<!DOCTYPE html>
<html>
<head>
	<title>My tour title</title>
        <!-- Meta for the ipad iphone detection -->
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
         
        <script src="tour.js"></script> <!--This one is for the ipad iphone tour -->
</head>
<body>
<div id="panodiv">
</div>
<script>
  var viewer = createPanoViewer({swf:"mytour1.swf",target:"panodiv"});
  
  viewer.useHTML5("whenpossible");
  
  if( viewer.isDevice("iPhone|iPod|iPad") )
    viewer.addVariable("xml", "tour.xml");
  else
    viewer.addVariable("xml", "swf_tour.xml");

  viewer.embed();
</script>
</div>
</body>
</html>


What I want to do, is create an unike krpano.swf and swfkrpano.js in a krpano folder, than in my scripts load the wanted xml
for the tour I want to show.
Like this:
general folder
| |
krpano folder tour folder
| |
Krpano.swf+swfKrpano.js mytour1 folder | mytour2 folder | mytour3 folder...

Here is what I've done:

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
<!DOCTYPE html>
<html>
<head>
	<title>My tour title</title>
        <!-- Meta for the ipad iphone detection -->
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
         
        <script src="general/krpano/tour.js"></script> <!--This one is for the ipad iphone tour -->
</head>
<body>
<div id="panodiv">
</div>
<script>
  var viewer = createPanoViewer({swf:"general/krpano/krpano.swf",target:"panodiv"});
  
  viewer.useHTML5("whenpossible");
  
  if( viewer.isDevice("iPhone|iPod|iPad") )
    viewer.addVariable("xml", "general/mytour1/tour.xml");   <!-- Here is my problem -->
  else
    viewer.addVariable("xml", "general/mytour1/swf_tour.xml");

  viewer.embed();
</script>
</div>
</body>
</html>

It's not loading well the tour images for example.
Anyone knows the best way to do it ?
Maybe Klaus ;-)
Thanks in advance !!
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

Yomas

Intermediate

  • "Yomas" started this thread

Posts: 190

Location: Anglet, France

  • Send private message

2

Friday, July 22nd 2011, 7:18pm

Okay Hi again !
For this tour I'm using the 720 blend pano, I think the problem goes here:

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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    <preview url="Talaiadata/Talaia0/preview.jpg" type="SPHERE" details="16"/>
    <!-- le pano lui-meme -->
 	<action name="addface">
		addhotspot(%1);
		set(hotspot[%1].url, %2);
		set(hotspot[%1].ath, %3);
		set(hotspot[%1].atv, %4);
		set(hotspot[%1].width,  1000);
		set(hotspot[%1].height, 1000);
		set(hotspot[%1].distorted, true);
		set(hotspot[%1].enabled, false);
		set(hotspot[%1].visible, false);
		set(hotspot[%1].alpha, 0.0);
		set(hotspot[%1].details, 16);
		set(hotspot[%1].zorder, %1);
	</action>


	<action name="addcube">
		addface(face_%1_F, %1_f.jpg,    0,   0);
		addface(face_%1_L, %1_l.jpg,  -90,   0);
		addface(face_%1_R, %1_r.jpg,  +90,   0);
		addface(face_%1_B, %1_b.jpg, +180,   0);
		addface(face_%1_Z, %1_u.jpg,    0, -90);
		addface(face_%1_N, %1_d.jpg,    0, +90);
	</action>


	<action name="setalpha">
		set(%1.alpha, %2);
		if(%1.alpha == 0.0, set(%1.visible,false), set(%1.visible,true));
	</action>


	<action name="setcubealpha">
		setalpha(hotspot[face_%1_F], %2);
		setalpha(hotspot[face_%1_L], %2);
		setalpha(hotspot[face_%1_R], %2);
		setalpha(hotspot[face_%1_B], %2);
		setalpha(hotspot[face_%1_Z], %2);
		setalpha(hotspot[face_%1_N], %2);
	</action>


	<action name="start">
		addcube(jour);
		addcube(nuit);
	</action>


	<action name="blendcubes720">
		set(overlap, 10);		<!-- set overlapping/blending range in degrees -->

		mul(edge1, overlap, 0.5);
		sub(edge2, 360, edge1);
		add(edge3, 360, edge1);
		sub(edge4, 720, edge1);

		mod(pan, view.hlookat, 720);
		if(pan LT 0, add(pan,pan,1440);mod(pan,pan,720); );

		if(pan GT edge2,
		   if(pan LT edge3,
			  sub(blend,pan,edge2);
			  div(blend,blend,overlap);
			 ,
			  set(blend,1);
			 );
		   if(pan GT edge4,
			  sub(blend,pan,edge4);
			  div(blend,blend,overlap);
			  sub(blend,1,blend);
			 );
		  ,
		   if(pan LT edge1,
			  add(blend,pan,edge1);
			  div(blend,blend,overlap);
			  sub(blend,1,blend);
			 ,
			  set(blend,0);
			 );
		   );

		sub(blend2, 1.0, blend);
		setcubealpha(jour, get(blend));
		setcubealpha(nuit, get(blend2));
	</action>


	<events onviewchange="blendcubes720();" />

The problem comes from the paths...
How can I edit the path here to solve it ?
Thanks again ^^
Best regards.
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

Yomas

Intermediate

  • "Yomas" started this thread

Posts: 190

Location: Anglet, France

  • Send private message

3

Saturday, July 23rd 2011, 1:35pm

Up Up please I'm getting crazy *cry* *cursing*
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

4

Saturday, July 23rd 2011, 8:18pm

Hi,

can you visualize the folder structure a bit better?
it's difficult to understand...

best regards,
Klaus

Yomas

Intermediate

  • "Yomas" started this thread

Posts: 190

Location: Anglet, France

  • Send private message

5

Monday, July 25th 2011, 10:13am

Hi Klaus !
Thank you for replying ^^
Here's a diagram of what I aim to do.(Morever if you have a better way I'm open ^^)

I managed to run tour1 for example, but as soon as I use variables in the xml path,
the paths to the tiles or graphics isn't good...
Also I had to put the "tours" folder in the "Krpano" folder...
In the case of this tour for example:

Source code

1
2
3
4
5
6
7
8
<action name="addcube">
		addface(face_%1_F, %1_f.jpg,    0,   0);
		addface(face_%1_L, %1_l.jpg,  -90,   0);
		addface(face_%1_R, %1_r.jpg,  +90,   0);
		addface(face_%1_B, %1_b.jpg, +180,   0);
		addface(face_%1_Z, %1_u.jpg,    0, -90);
		addface(face_%1_N, %1_d.jpg,    0, +90);
	</action>

I used here the blend tour example found on the forum, but the links to the tiles isn't good.
In the original tour the tiles was in the root krpano folder.
But I want to dry all that ^^
Thanks for your help !

PS : Also using a lightbox to show the tours, I'd rather if you know a way to pass more than one variable
in the html path?
Like this :

Source code

1
<a  href="tour/krpano/krpano.swf?tour1/flash_tour.xml%lightbox[width]=700&amp;lightbox[height]=400">click here</a>

Thanks again !!
Best ragards.
Yoann.
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

6

Thursday, July 28th 2011, 5:02pm

Hi,

paths in the xml that were defined per "url" attribute will be automatically adjusted by krpano so that they were relative to the xml where they were defined,

but when using/setting paths dynamically per action this is not possible, these paths are relative to the basedir, which is %FIRSTXML% by default,

you could either change the basedir variable and/or use path placeholders in the dynamic url,

see here:
http://krpano.com/docu/xml/#url-notes

best regards,
Klaus