Posts by Anoril

    Hi there!
    I'm working on some stuff and I have to efficietly parse children of Layers. Because I got a lot of layers and children, I decided to store the children nodes into a parent array instead of having a loop through all layers available. (That may be inconsistent, just tell me if you have better idea *wink* ).

    OK, to get you see, Here is the expected structure:

    Code
    <layer name="Parent">
       <layer name="Child0" />
       <layer name="Child1" />
    
    
    </laver>

    This structure is created by an action:

    This works like a charm.

    The point is that the "showSubItem" action acts correctly with a direct "show" command:

    Code
    <action name="showSubItem">
       for( set(i, 0), i LT subItems.count, inc(i),
    
    
      	set( subItems[get(i)].item.alpha, 1.0 );
      );
    </action>

    But when using a TWEEN command, it works ONLY for the items with index greater than 0... i.e. the first item (idx=0) does not show.

    Code
    <action name="showSubItem">
    for( set(i, 0), i LT subItems.count, inc(i),
       tween( subItems[get(i)].item.alpha, 1.0, 3.0 );
      );</action>


    Note that I found a workarround by modifying the index reference (saying it's a nonsense, as the index will ever be 0-N, but anyway, there is here a black-magic trick):


    I guess it is something about item-array naming convention or somewhat...

    Regards,

    Paul

    Hello all!
    I'm playing with KRPano and for some technical and performances reasons, I decided to work in XML file with both Javascript and Native actions.
    Today, I'm struggling hard to get the things work together! :)
    Calling is an javascript-type action from a standard KRPano native-action is straight forward:

    Code
    <action name="caller">
       callee();
    </action>
    
    
    <action name="callee" type="javascript">
       console.debug("yeepee");
    </action>


    But for some technical reasons, it's more complicated the other way:

    Code
    <action name="caller" type="javascript">
       krpano.call("callee()");
    </action>
    
    
    <action name="callee">
       trace("yeepee");
    </action>


    When the Big Deal comes, it is when we start talking about parameters... Once again, Native-to-JS is trivial, but the other way is not.
    I ended to this point: because I must give my actions arrays, I instanciate arrays in calls before to call the expected actions:


    Code
    <action name="caller" type="javascript">
       var val1 = "plouf";
       var val2 = 4*6;
       krpano.call("def(my_array, array);set(my_array[0], "+val1+");set(my_array[1], "+val2+");callee()");
    </action>
    <action name="callee">
       trace("Provided values are:", get(my_array[0]), " / ", get(my_array[1]));
    </action>


    I'm not sure this is very optimal ;) and it looks very.very ugly :D
    Do you know a better way?
    Image I work with very long arrays I have to declare in loops and construct a call-string before to launch the action... This is very poor in performance. :/
    Best regards and thanks for your enlightened help!

    Hello!
    I am asking myself: How do I check SphereToScreen result validity?
    A call set vars with resulting data, but some times, when hotspots are out of screen, data is "NaN".
    My point is that I don't know how to test "NaN"...


    Code
    sphereToScreen(a, b, c, d);
    if( c == NaN, trace(is NaN), trace(is not NaN));
    if( c == Number.NaN, trace(is NaN), trace(is not NaN));


    Above code does not work...
    I tried to check against screen dimensions, but that fails too : NaN is both greater and lesser than any number ;)

    regards,

    Hi !
    I'm experiencing a destabilizing behaviour with arrays.
    I want a global array to store data. In a high-level action, I ask for array creation as documented:

    Code
    def(miaou, array);


    Then I start using it:

    Code
    set( miaou[0].stuff, "meow" );


    But this tells me :

    Quote

    WARNING: set miaou[0].stuff=meow - miaou is not an array!

    ... WHY ?!?
    If I don't use DEF(), it works... ^_^ But I don't really like using data I don't initialize...
    Pleaaaase, help ! :D

    Hi!

    I'm going crazy with scene loading issues. (1.19-pr4 up to 6)

    This project : http://anoril.no-ip.com/360/DemoHeadset/ does not work the same way on Mobile and laptop browsers.
    Even in Chrome, it does not play the same way as in Chrome emulating a device!

    1_ On mobile, my first scene is played and quickly replaced with the second scene, which is not called with "loadscene" from anywhere!
    Using a laptop browser (Forefox/Chrome) all works fine: the first scene is loaded, played successfully and that's it. On mobile devices (or emulated) the second scene is loaded and start to play, overriding first scene content... :(

    2_ I can't play a video twice.
    The menu show four buttons which load a specific scene (360 video). When the video ends, we reload the menu scene. If we click again on an already-play-video-button, nothing happens: the video, which has been restarted (seek(0), pause()) does not read anymore...

    Files are there:
    http://anoril.no-ip.com/360/DemoHeadset/root.xml
    http://anoril.no-ip.com/360/DemoHeadset/content/credits.xml
    http://anoril.no-ip.com/360/DemoHeadset/content/menu.xml
    http://anoril.no-ip.com/360/DemoHeadset/content/videos/xml

    Best regards

    Paul

    [EDIT]
    OK, the point was I copied Klaus' code but missed to unterstand it plainfully: the mobile device trick was to start the videos on user interaction THEN to pause them. Because I have four videos, I wrote a loop to achieve this. But the "delayedcall" was using an inconsistent for-i value then was pausing only the last video of the list... Because video ending triggers menu laoding, well... I was redirected to menu...

    And this happened only on devices because video autostart behaviours is "devices=mobile"... :)

    Hello all!

    I'm trying to get this working:

    A WebVR experience with an animated introduction.

    The introduction consists in several logos and texts to be displayed, one after the other, in full-stage: a black background layer hides the 360 view while logos are displayed. At the end, I hide the background layer to get the user viewing the actual panorama.
    I made this with simple delayed calls and it works fine.

    But I want it to work with a VR headset. So I placed a "Start" button which triggers "webvr.enterVR(); startIntro();"
    This works too: we enter VR mode and the introduction animation starts.

    My point is that the introduction is played FULLSCREEN! I mean: Instead of having a 3d imersive view with the introduction displayed on EACH eye, the layers (background, images and texts) composing the introduction are displayed on BOTH eyes: a single image is cut in half, having a part seen on the left eye while the other part is seen on the right eye! Very disturbing...

    How can I do?

    First, to get the layers working, I set "vr" to "true" thus they are not removed when entering VR mode... But I supposed that's not enough...

    Best regards,

    Paul

    Hello!

    I'm still having this king of issue (1.19-pre5) : I can't resize my text in HTML5 using textfields (I did not tried Flash and I'm not interrested in Flash anymore ;) ).

    I had to make use of an external HTML page to be displayed using CSS trick "font-size: 18vm" (with "vm" not yet accepted by all browser ^_^' ). Actually, "vm" is not understood by KRPano even when let managed by the browser (weird to me actually...)

    So, if you have an esay step to get my Textfield content scaled to my viewport, I would greatly appreciate! :)

    Thanks all,

    Paul

    Hello all!

    I experience a strange issue with Autorotate.

    For the first time, I want to programmatically activate it or disable it. Thus I got an action that calls, as depicted in the documentation, "autorotate.start()".

    But when it comes to call this, I have this error message:

    Code
    WARNING: unknown action: autorotate.start

    It works when I use

    Code
    set( autorotate.enabled, TRUE );

    I a bit disapointed :)

    I'm using 1.19-pr3, HTML5, Win7, Firefox.

    Best regards,

    Paul

    Hello there!

    I raise this thread as I'm very interested in having that king of data from a sound (html5 only).

    Maybe someone has a pretty solution (or Klaus has?)...

    For those interested with a workaround, I would set a kind of "data" tag with file name and manually entering the time I KNOW it is. Then , by using the frame rate/timeelapsed, you are able to know the percent of the file played.

    The Very Ugly Way:
    (I'm sure a better person that I will produce a more efficient code)

    Code
    <data name="soundstuff" fileurl="my.mp3" length="180" elapsed="0" />
    <action name="onstartsound">
       tween(data["soundstuff"].elapsed, 1, get(data["soundstuff"].elapsed), default, trace("finished :)"));
    </action>
    
    
    <action name="onrefresh">
       trace("We are at ", get(data["soundstuff"].elapsed), "/", get(data["soundstuff"].length), " of the file...");
    </action>

    I know. It's awful, but it's the way I found ;)