Help! Can't set the correct tweening sequence!

  • Hi! My skill level in XML programming is just at the entry, so I badly need some help with my problem. Hope it is really easy for any experienced guys.

    I am trying to set a little animation for my virtual tour. What I need to do is to start the scene with some position and once it is loaded I need it to zoom out anr look at the other specified position. The initial co-ordinates are set in the hotspot, that leads to the scene. And they are:

    Code
    lookat(85,0,40);

    Once the new scene is loaded I need it to smoothly zoom out to FOV=80 and then look to position +224,0

    So for the new scene onstart event I use:

    Despite the tweening commands are as above the action in any case goes first look at 224,0 and then zoom to FOV 80.

    Any help how to resolve the problem is warmly welcome.

  • Hi boxx1,

    Have a look to the moveto(toH,toV,motiontype) , zoomto(fov,motiontype) and lookto(toH,toV,fov,motiontype) actions: https://krpano.com/docu/actions/#lookto

    So, your code should be:

    SAlut.

  • Yes it works great. I experimented with those commands, but with no success. Now it is perfect and smooth.

    By the way, what was wrong with the tween command? Isn't it working in the order that you write it? It seems that it has some default priority order, like rotation first or something.

    Thanks again for your help.

  • Hi boxx1,

    Zitat

    By the way, what was wrong with the tween command?

    Each tween are executed in "parallel"...
    So, in your example, the first tween has a time of 1 while the next tween has 0.5... that's why the first tween seems to be executed after the next one...
    To make tweens to be executed in "series", you have to set a WAIT flag to the tween.

    • WAIT flag for the tween() action

      • waiting until this tween has been finished before the next action command will be executed
      • usage:

        Code
        tween(variable,destinationvalue,time,tweentype,WAIT);

    SAlut.

  • Many thanks, michel.

    But I have another question.

    The aim of this tweening and animation was to create the feeling of the space and direction for the person who is using a virtual tour.

    So once he moves all the way forward he faces all the "FORWARD" hotspots. When the new scene opens, it shows the position where the previous scene was (using the lookat(85,0,40);command), then zooms out and rotates to face the direction and shows the next "FORWARD" step. This is achieved by

    Code
    zoomto(80,smooth());
    
    
    moveto(224,0,smooth());

    So when you go the virtual tour all the way forward it works great and makes a feeling of the 3D walk.
    But when you try to move back it is messing down all your feeling of direction. Because it

    • turns onto the back hotspot,
    • then zooms it in,
    • then loads the previous scene facing the position where you have just left from,
    • zooms out,
    • and the messy part is right here: it makes a slight move and returns you to the same position, where you have just left from.

    Here is an example: http://v-city.eu/est/tours/fairs/meremess/meremess.html

    What it should do is to rotate the view to the other BACKWARD hotspot on the loaded scene.

    So my question is:
    Is it possible to programm the behaviour of the next scene in the loadcsene description of the hotspot?
    In my example i need to programm the initial position of the loaded scene, initial FOV, change of FOV and rotation to a specific position.

    My hotspot looks like this:

    Code
    <hotspot name="spot-1-forward" url="spots/fwd.png" ath="+265" atv="+10" scale="0.85" zoom="true"
         alpha="0.8" 
         onover="freezeview(true);tween(alpha,1);tween(scale,1.2);showtext(STEP FORWARD, arrows);"
         onout="freezeview(false);tween(alpha,0.8);tween(scale,0.85);"
         onclick="freezeview(false);lookto(265,1);zoomto(50,smooth(200,200,400));loadscene(scene2, null, MERGE, BLEND(1));lookat(85,0,10);"
         />

    lookat(85,0,40); works great but helps only with the initial position of the new scene.

  • To be honest, I do not really read your question accurately *smile* ... So my answer could be no accurate too *wink* ...

    I suppose that you are looking to the looktohotspot(hotspotname,fov*,motiontype*) action.
    So, your hotspot code could be:

    Code
    <hotspot name="spot-1-forward" url="spots/fwd.png" ath="+265" atv="+10" scale="0.85" zoom="true"
         alpha="0.8" 
         onover="freezeview(true);tween(alpha,1);tween(scale,1.2);showtext(STEP FORWARD, arrows);"
         onout="freezeview(false);tween(alpha,0.8);tween(scale,0.85);"
         onclick="freezeview(false);looktohotspot(spot-1-forward,50,smooth(200,200,400));loadscene(scene2, null, MERGE, BLEND(1));lookat(85,0,10);"
         />

    Hope this is what you are looking for...

    SAlut.

  • Here is a snippit from what I use. I believe it achieves most of your wishes, although this code does not pan. You may have to modify it for scenes but basically follow the looktos and zoomtos.


    This code zooms into the hotspot clicked and then loads the pano facing the direction from which it zoomed from . Then it zooms out to 90 degrees fov.

    Of course, you must change the cords. of 176,0 to the cords of where the hotspot that goes back to the previous scene is.


    onclick="looktohotspot(secondbath);
    loadpano(secondbath.xml, null, MERGE, BLEND(1));
    lookat(176,0,10);
    zoomto(90,smooth(720,50,360));"

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!