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:

    Code
    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

  • 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');
    );

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!