ascot4fusion / ascot5

ASCOT5 is a high-performance orbit-following code for fusion plasma physics and engineering
https://ascot4fusion.github.io/ascot5/
GNU Lesser General Public License v3.0
32 stars 9 forks source link

Keyboard controls for 3D plots that millenials could use #79

Closed miekkasarki closed 9 months ago

miekkasarki commented 9 months ago

The keyboard controls provided by VTK/Pyvista are very unintuitive. We need something like what FPS games have.

I've already implemented this and I'll proceed with merging. However, there is an issue which anyone is welcome to fix. I couldn't figure out how to toggle off (all) the pre-existing commands meaning I had to use whatever keys where free instead what I'd wanted (wasd + arrow keys).

So the current bindings are:

    p.add_key_event('w', lambda : control_camera('move_forward'))
    p.add_key_event('s', lambda : control_camera('move_backward'))
    p.add_key_event('a', lambda : control_camera('move_left'))
    p.add_key_event('d', lambda : control_camera('move_right'))
    p.add_key_event('n', lambda : control_camera('move_up'))
    p.add_key_event('m', lambda : control_camera('move_down'))
    p.add_key_event('r', lambda : control_camera('rotate_cw'))
    p.add_key_event('y', lambda : control_camera('rotate_ccw'))
    p.add_key_event('t', lambda : control_camera('look_up'))
    p.add_key_event('g', lambda : control_camera('look_down'))
    p.add_key_event('f', lambda : control_camera('look_left'))
    p.add_key_event('h', lambda : control_camera('look_right'))