keybaccelerate. Is it broken?

  • Using keyboard arrow keys for navigation I noticed that movement started suddenly. The keybaccelerate parameter is supposed to take care of that but it doesn't matter if I set it to 1.0, 0.5, 0.1 or 0.01, motion always starts the same and suddenly. Deceleration is nice and smooth, however.

    Bug or am I missing something?

    Code
    <control   keybspeed="0.3"  keybaccelerate="0.1" />
  • Apologies. I did not explain that well at all.

    I just tested with your distribution files so we know it isn't my brilliant programming causing a problem. *wink*

    In your vtourskin.xml, you have a setting for keybaccelerate. No matter what I set it for it immediately starts at speed and never gets faster. with a setting of 0.1 it takes something like 3 seconds to make it around once and stays that speed with each rotation. If I set it to .01 it takes 40 seconds to go around. if I set it to 1 it takes maybe 0.5 seconds.

    This is without setting a keybspeed parameter so it is using the default of 10. If I manually set it to 10 I get the same results but if I set it to 1 then a keybaccelerate setting of 1.0 or 0.1 takes about 4 seconds to go around once. Using 0.01 still takes roughly 40 seconds.

    If I understand correctly, panning motion speed with an arrow key should start at 0 and then increase each frame(?)tick(?) by the amount of the keybaccelerate value until the speed reaches what is set for keybspeed and then stay at that maximum speed. That isn't what I am experiencing.

  • Hi,

    sorry, but I can't see or find any problem there...

    But maybe one additional note - the acceleration also depends on the current field-of-view (view.fov), the more zoomed-in the more the acceleration is automatically reduced.

    Best regards,
    Klaus

  • By "can't see or find any problem there" do you mean that you don't see any problem in what I described or that you can't reproduce it?

    In my tests the fov stayed the same so that shouldn't be a factor.

    Is my understanding of how keybspeed and keybaccelerate correct (in my last post) correct? Or where do I have it wrong?

    Thanks for your continued help!

    Scott

  • Hi Klaus,

    I fear I still haven't explained the issue clearly so I put together a demo.

    In the XML I just have: <control keybspeed="10" keybaccelerate="0.1" />

    Clicking the buttons just changes keybaccelerate to the value shown.

    The documentation says:
    keybaccelerate: The acceleration of the keyboard / button controlled moving.
    keybspeed: The maximum moving speed of the keyboard / button controlled moving.

    In practice, changing keybaccelerate changes the maximum moving speed. It does not change the acceleration. The speed it starts with on pressing an arrow key never changes/accelerates. It is almost as if the acceleration loop fires only once.

  • Hi,

    the problem here is the keybfriction value in your case - with small keybaccelerate values it decelerates the speed quicker then it can accelerate.

    Technically it works that way:
    - the keybaccelerate value (but scaled by the fov) is added to a motion vector (every frame tick)
    - that motion vector is scaled down by the keybfriction value
    - then the motion vector length (the speed) is limited/capped by the keybspeed value
    - then the result is added to the current position

    Best regards,
    Klaus

  • I don't understand. I tried variations of keybfriction values before to no good effect. Adjust either or both and it affects the maximum rotation speed. To me, that isn't ideal. There seems to be no combination that allows you to ease into full speed.

    I just updated the demo to include keybfriction setting variations. (And of course, a value of 1 or higher causes critical problems.)

    What I am after is a way to prevent an immediate jump to full speed when pressing an arrow key. It feels better when you ease into it in the same way that letting up on the key doesn't stop the motion immediately. Could you give us an example of settings that would allow this?

    Thanks for your continued help.

  • Hi,

    the keybaccelerate and keybfriction value would need to get changed only very little, I would say keybaccelerate in the range 0.01 and 0.5 and keybfriction in the range 0.8 to 0.99999...

    That formal is currently used (there are fore sure better solutions possible):

    Code
    speed = (speed + acceleration) * friction
    if(speed > maxspeed) speed = maxspeed;
    position = position + speed


    So the combination of both settings, keybaccelerate and keybfriction is important, they are linked together. When reducing the acceleration, the friction would need to get increased (toward 1.0).


    In the default vtourskin.xml I'm using these settings:

    Code
    keybaccelerate="0.09"
    keybfriction="0.94"


    Here an example:
    https://krpano.com/releases/1.20.…-corfu/tour.xml

    Btw - if you want you can also set control.usercontrol to "mouse" and implement a fully custom keyboard control. As example for such the depthmap_navigation.xml (in the plugins folder) could be used, there a custom keyboard control is used for the 3D movement.

    Best regards,
    Klaus

  • Thanks Klaus,

    Now I understand the issue:

    Code
    speed = (speed + acceleration) * friction


    This results in an acceleration curve with a quick ramp-up then slowing acceleration, something like an easeoutcubic or even more severe curve. The only combinations that don't result in a seemingly sudden start at speed result in a lower max speed and really long slow-down.

    We can make a custom method, as you suggested. For your consideration on a future release of KRPano, I might suggest something like:

    Code
    if(keydown,
        speed = speed + keybaccelerate;
        if(speed > maxspeed, speed = maxspeed);
    ,
        speed = speed * keybfriction;
    );


    With something like the above the settings do exactly what the say they do and you can set them to get exactly the effect you want.

    This wasn't so much an issue when using the Quicktime style of mouse movement, but since the world has settled on -- let's call it Street View style -- arrow keys for smooth continuous panning is vastly more important.

    Anyway, thanks for the time you spent on this.

Jetzt mitmachen!

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