Code Monkey home page Code Monkey logo

Comments (1)

michaliskambi avatar michaliskambi commented on June 7, 2024
  1. I fixed the issue of first mouse wheel not working for zoom, along with a bigger rework of walk/fly handling: 38380d6

  2. As for your own applications:

    Inputs are configurable in CGE, you can change them in your own applications, using e.g.:

    MyWalkNavigation.ZoomEnabled := false; // this is already default in CGE
    MyWalkNavigation.Input_UpRotate.Assign(keyNone, keyNone, '', false, buttonLeft, mwUp);
    MyWalkNavigation.Input_DownRotate.Assign(keyNone, keyNone, '', false, buttonLeft, mwDown);

    or (simpler, if you don't care about initializing all input fields and want to just add mouse wheel):

    MyWalkNavigation.ZoomEnabled := false; // this is already default in CGE
    MyWalkNavigation.Input_UpRotate.MouseWheel := mwUp;
    MyWalkNavigation.Input_DownRotate.MouseWheel := mwDown;

    I tested above, and we had a bug (assigning mouse wheel to Input_UpRotate/Input_DownRotate didn't work), it is now fixed in castle-engine/castle-engine@6ff413b . So above examples really work :)

  3. As for what is best for view3dscene, CGE editor, and engine defaults:

    I did give it quite some thought, and I don't consider mouse wheel as a good choice (by default) to look up / down.

    Mouse wheel should 1. do zoom (yes -- this is practically the same as walking forward / backward in fly mode), 2. or change move speed, when in MouseLook mode.

    This applies to both CGE editor and in view3dscene, as I want them to be consistent for users. And my recent changes make them more consistent, e.g. mouse look is now easily available in view3dscene if you hold Right mouse button, just like in CGE editor, and mouse wheel then changes speed.

    This treatment of mouse wheel is:

    1. Intuitive to users. I did test CGE editor on other people, including professional 3D people :) Conclusions: Mouse wheel should really do a zoom, regardless of mode (examine or walk), this is intuitively expected by people.

    2. Consistent with other software. Godot, Unity, Gestaltor, Blender are examples of software I look upon closely. It's not a perfect correspondence of course (e.g. Blender has a special "fly mode" activated by Shift+~ instead of right click), but I believe people can see it is "analogous when it makes sense". They all use mouse wheel as described above (zoom, or change speed in mouse look mode e.g. when you hold right mouse button).

    3. Personally, I also think it's not comfortable to look up / down with mouse wheel (or some keys) anymore. I had a different point of view long time ago, when mouse was not always guaranteed, and you needed to provide some keys to look up / down. Nowadays, when everyone has mouse, mouse look is really a superior way to look around in 3D.

    For games, we provide by default a rather "conservative" input shortcuts, to not be surprising (so e.g. AWSD work by default, but not much more, with TCastleWalkNavigation) and encourage developers to activate mouse look to navigation on desktop (examples/fps_game, examples/physics/physics_explosion, examples/physics/physics_3d_shooter, ...).

These are the current shortcuts in view3dscene:

Zrzut ekranu z 2023-02-27 03-20-58

from view3dscene.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.