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.

1

Monday, August 30th 2010, 11:43pm

send parameter to a scene with loadscene()

Hi all,

Each of my panoramas are in <scene> tags, that I load with loadscene. The thing is I want the scene to load different images depending on a parameter I could provide in the loadscene(). For instance, I have a kitchen, which can be viewed classic, modern, old style...

So my question is: can I modify my actual code below to send a parameter to the scene from loadscene()?

Or do you think I have to write the same code thrice, one for modern, old, and classic style? It would be almost the same code, which is not very nice I think...

my call to loadscene:

Source code

1
loadscene(kitchen, "null", MERGE);



my kitchen scene:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<scene name="kitchen" onstart="action(startscene);">

<action name="startscene">
action(activatespot, kitchen, 40);
set(plugin[radar].heading, 0);
</action>

<image type="CUBE">
<left  url="../images/kitchen/classic/left.jpg" />
<front url="../images/kitchen/classic/front.jpg" />
<right url="../images/kitchen/classic/right.jpg" />
<back  url="../images/kitchen/classic/back.jpg" />
<up    url="../images/kitchen/classic/top.jpg" />
<down  url="../images/kitchen/classic/bottom.jpg" />
</image>

</scene>


Thanks a lot!

2

Monday, August 30th 2010, 11:55pm

I believe just creating three scenes would be what you are looking for. Say
kitchen_modern
kitchen_classic
kitchen_old

Or whatever you wish to name them.

3

Tuesday, August 31st 2010, 10:11am

Thanks for your answer, I tried to find a different way since I have lots of other code in my scenes, and I wanted to avoid code duplication...

But if there's no other solution I'll just do that!

*thumbsup*