moveto/lookto and zoomto together... ?

  • Hi !
    I would like to associate to action together as transition from a pano to another...
    If I use "lookto", first I have a move, then a zoom... (nearly to a right-angle)
    I want the "move" to finish in the same time than the "zoom" (nearly to a sigmoid or something like "easeInOutSine")
    So, I want to use the "tween code", but I don't know the correct syntax to have both in the same time...

    Code
    <hotspot name="caserne"
    			onclick="moveto(60,0);tween(zoomto,60,0,easeInOutSine);load(cncs_02.xml,null,MERGE);lookat(270,0,80);">
    		   ...
    </hotspot>

    Thanks

    David

    Edited once, last by sagedavid (April 6, 2009 at 12:17 AM).

  • Hi,

    the moveto/lookto/zoomto actions don't work on a time-basis,
    the time they need depends on the distance between the current and
    the destination view point,

    you can use tweens too, but:

    Code
    tween(zoomto,60,0,easeInOutSine);

    will not work

    to change the zoom you need to change the "view.fov" parameter, e.g.:

    Code
    tween(view.fov,60,1,easeInOutSine);

    you could change the hlookat/vlookat in the same way:

    Code
    tween(view.hlookat,60,1,easeInOutSine);
    tween(view.vlookat,0,1,easeInOutSine);
    tween(view.fov,60,1,easeInOutSine);

    best regards,
    Klaus

  • Ok, so... my code is this one, now :

    Code
    onclick="tween(view.fov,10,2);
    					tween(view.hlookat,75,2);
    					tween(view.vlookat,0,2);
    					load(pano_02.xml,null,MERGE);stopallsounds();
    					action(hideallimages);lookat(270,0,80);">

    The problem is :
    - it load pano_02 before making the move...
    Must I add a "wait time" for the pano loading ?

  • Ok, I added "wait(1)", and it's ok...

    Code
    onclick="tween(view.fov,60,1);tween(view.hlookat,70,1);tween(view.vlookat,0,1);wait(1);
    					load(cncs_02.xml,null,MERGE,ZOOMBLEND(1,2));stopallsounds();
    					action(hideallimages);
    					lookat(270,0,80);">

    The only problem is that my "lookat(270,0,80)" command - at the end, for the 2nd pano - doesn't take effect...


    PS : with the "tween(hlookat)" command, it always turns "counter-clockwise"... It isn't "direct" : even if I'm at H=60, it turns all around to 70 *g* *cry* !!!

    Edited 2 times, last by sagedavid (April 6, 2009 at 11:15 AM).

  • Ok, too solve my problem of "bad landing" in the next pano, I've putted my "v & hlookat" and "fov" in the "view" code...

    Now, an other BIG PROBLEM... It sounds like A BUG !
    If I turn three times in my pano, and then click on the hotspot to the next one, krpano makes my turn back three times before the transition !!!!!!!!!!

    If somebody can explain me...

    It looks like if krp consider that, after one revolution, 0° is no more 0° but 360°, two revolutions 720°, etc.

    Edited 2 times, last by sagedavid (April 7, 2009 at 1:48 PM).

  • Well...

    It's not really a bug, it is inherent to the tween which just go from one value to another.

    It may sound strange that the vlookat/hlookat go beyond the 360°, but even if we would constraint this, it would not solve the problem where you would be at e.g 270° and want to go to 10°: it will rotate 260° counter-clockwise while the shortest path is 100° clockwise.

    If you want to tween your hlookat / vlookat, I would sugget to normalize your coordinates before tweening, so if you want to tween to (70,0), you could do something like:

  • Well...

    It's not really a bug, it is inherent to the tween which just go from one value to another.

    It may sound strange that the vlookat/hlookat go beyond the 360°, but even if we would constraint this, it would not solve the problem where you would be at e.g 270° and want to go to 10°: it will rotate 260° counter-clockwise while the shortest path is 100° clockwise.

    If you want to tween your hlookat / vlookat, I would sugget to normalize your coordinates before tweening, so if you want to tween to (70,0), you could do something like:

    is it still working in newest ver of krpano?

Participate now!

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