Floating object How to do it krpano

  • Hi Milo,,

    i've seen it and what i saw was that the size of the stage of (when it's swf) changes all the time as it turns.. i'm not sure if you can do that with swf...??


    Like to know this as well

    and how to mke it for mobile phones *cry*

    Cheers

    Tuur *thumbsup*

  • yes, that could be done with tweens

    just make a very long linear tween of the rx,ry or rz values of a distorted hotspot:

    here is quick example:
    https://krpano.com/examples/108b8…,10000,linear);

    and here is the code for a example, where it stops rotating on mouse over:

    best regards,
    Klaus

  • this is great! first thing that popped into my head when i seen this is ... can we take a 360 degree object and use it in the pano in the same way? a ball rotating, on object icon that rotates and be clicked on to activate something. flipping and turning a 360 object would be phenominal.

  • Hi everybody,
    first sorry about my english...
    and to Klaus: excellent job,
    but for me as a "NOT-Coder" without a good documentation it is very hard to find the code for the
    thing I will do, you understand? I know, documentation is a hard job and the last thing to do...
    Now my problem:
    I used the code of Klaus' example for this floating objekt in the nadir, but the problem is:
    how to turn the object into the correct hlook?! so that it is possible to read the word on the pic?
    you know what I mean?
    the object has to turn horizontally to the monitor on every "onover"
    example:
    http://www.planorbis.de/tmp/test

    thanks Mario

    sorry, but I find a new problem: when I click on a video the turning hotspot is no more visible, so if you try this,
    not click on a video; I am trying to solve this

  • Hi,

    klaus when you show an example can you keep the editor plugin installed so we can take a closer look at the xml

    I have posted the code above,

    but just add the editor by yourself
    e.g.
    https://krpano.com/examples/108b8…gins/editor.swf

    I haven't made a new example, I have just taken the nadir logo example and added a new "onloaded" event by passing it as parameter in the url,

    have a look at the full url of the example:
    .../krpano.swf?xml=examples/nadir-logo/nadir-logo.xml&hotspot[nadirlogo].onloaded=tween(...

    the same can be used for the plugin editor, just add
    &plugin[editor].url=plugins/editor.swf


    Quote

    Hi everybody,
    first sorry about my english...
    and to Klaus: excellent job,
    but for me as a "NOT-Coder" without a good documentation it is very hard to find the code for the
    thing I will do, you understand? I know, documentation is a hard job and the last thing to do...


    sorry, yes, I know the documentation...
    this was done in this example:

    Code
    onloaded="tween(rx,1000000,10000,linear);tween(ry,1000000,10000,linear);"


    in the onloaded event two tweens are started,
    these tweens are changing the rx and ry values from 0 to 1000000 in a time of 10000 seconds with linear movement,
    this was done to simulate a continues rotation,

    Code
    onover="stoptween(rx,ry);mod(rx,rx,360);mod(ry,ry,360);tween(rx,0);tween(ry,0);delayedcall(0.5,set(onoutready,true));"
    onoutready="false"


    when mouse comes over the image, the tweens were stopped,
    then the rx and ry value is cutted down to the range from 0 to 360 with the modulate operator,
    this was made to be able to tween back to 0/0 in a short way,
    because while tweening back to 0/0 it would be possible that the mouses leaves the image
    and the onout event gets be called, in the onout event the rotation will start again,
    so the onout shouldn't start before the tweens were done,
    I used a custom variable (onoutready) to make sure that it doesn't start rotation until the tweens were finished,
    the default tween time is 0.5 second, so I set the "onoutready" value to "true" after this time,

    Code
    onout="if(onoutready, call(onloaded);set(onoutready,false); );"


    when the mouse leaves the image, it starts rotating again,
    to avoid duplicate codes, the "onloaded" event is called and the "onoutready" flag is set back to "false",

    I know that's very trick but this open ways to many other possiblites

    do you want the video to be at the same place like in the real pano?
    in this case you don't need "flying" hotspots, just move/scale/rotate(tween) the video to the correct position in the video,
    (find it with the editor plugin)

    best regards,
    Klaus

  • does the trick of adding

    Quote
    Code
    &plugin[editor].url=plugins/editor.swf

    work for any KRPano page or does this only work with your example here? Pretty cool to have a method to reveal codes.

Participate now!

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