You are not logged in.

1

Tuesday, June 10th 2014, 8:57am

Array with scenes

Hi,

could someone maybe help me with the array topic?
I would like to make my own panorama view based on the
demotour-corfu.

As I know it from different programming languages I would like to make an array full off scenes,
but is that even possible in krpano?

createarray(areas);
set(c,0);
for(set(i,0), i LT scene.count,
inc(i),if(scene[get(i)].area == true,
set(areas[get(c)].value, get(scene[get(i)].content));
inc(c);
);
);


When I trace the array:

Source code

1
get(areas[get(c)].value)

it is a object Kinterface_dynamicitem.

Is there any possibilty to make an array full of scenes and to use each item of the array as a scene, like : areas[get(c)].name ?

Thank you for your help and have a great day :).

With best regards,

Zunye

2

Thursday, June 12th 2014, 6:05pm

Hi,

your posted code looks okay and should already work as it is...

Can you show the full example?
The error must be somewhere else...

Best regards,
Klaus

3

Wednesday, August 14th 2019, 2:08pm

It seems normal, you inc your variable c after use so when exit the loop it is one more than you want.

With this code it should works better:

createarray(areas);
set(c,-1);
for(set(i,0), i LT scene.count, inc(i),
if(scene[get(i)].area == true,
<!-- inc before use -->
inc(c);
set(areas[get(c)].value, get(scene[get(i)].content));
);
);

<!-- when use c it is at the last index or -1 if no scene into areas-->
if(c GE 0,
trace('last area is ', get(areas[get(c)].value));

,
trace('No area');
);