3D scene: Navigation modes

Involved development of the OpenMW construction set.
anahuj
Posts: 31
Joined: 29 Dec 2013, 03:26

Re: 3D scene: Navigation modes

Post by anahuj »

I have nothing to add to specs but I have implemented a navigation system
based on Jim Blinn's article on Nested Transformations and Blobby Man.

The system has x/y/zscreen and x/y/zlook points; spin and back rotations.
There is third rotation for roll but if it is the default, the turntable stays
horizontal (important).

When zscreen is other than 0, the camera is out of the look at point, and
we have the turntable.

When zscreen is 0, the camera is in the look at point, and we have
first person view.

So, the switch between the first person view and the turntable view
is smooth. The camera in Skyrim/Oblivion works equally smoothly
when the view is changed via scroller between 1. and 3. person modes.
(Check also Tomb Raider 2013 how camera rotates around the Lara.)

I have implemented the look-at-point movement like in Gabriel Knight 3;
or as said, like in Unreal editor. When I move mouse forward/backward,
the look-at-point -- the camera when zscreen = 0 -- goes forward/backward.
Left-right mouse movement spins the camera. I have XY and Z translations
as well.

Note: There are no test for if zscreen equals 0. It all works transparently, and
the implementation was very simple.

The navigation in Creation Kit etc. is more complex. E.g., what happens
when we activate another object. E.g., how the camera is dolled via scroller.
I have to think about them more.

The ideas in Mount&Blade editor should be easy to implement in the
mentioned system.
SquireNed
Posts: 403
Joined: 21 Dec 2013, 22:18

Re: 3D scene: Navigation modes

Post by SquireNed »

Alternatively, consider the Arma series' built-in 3d editor.

It's a standard WASD movement as one would expect from a spectator cam (except for the fact that one only moves horizontally), and QZ are used for altitude. It's not perfect, but it leaves the mouse wholly free.

Also, if you do any switching between mouse-interaction and mouse-look, I'd recommend it being (or being configurable to be) a toggle; that way people like me with extra buttons on their mouse can switch on the fly without having to hold things.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 3D scene: Navigation modes

Post by Zini »

The first iteration of the navigation system is now in master. Please test!

A few points to consider:
- This is only the first iteration. We will most definitely improve the system further.
- Other navigation modes can be added later. We should even consider allowing editor plugins to add navigation modes.
- Input focus handling is a bit wonky at the moment. When opening the scene sub view and after clicking outside the actual rendered scene you will have to click on the scene again, before it accepts keyboard input. Needs further work, but not my priority now.
- Navigation modes can be selected via the button on the left bar. This buttons pops up another bar with 3 buttons, one for each mode. The icons on these buttons are placeholders (I just used some random icons that are already in use elsewhere).
- There are currently several hardcoded values that influence how the navigation system works (e.g. mouse sensitivity). These will be made configurable, once we have a properly working user settings implementation (*cough*). Likewise all key-bindings (including mouse buttons) will be made configurable eventually.

The navigation modes are (from left to right):

1. First Person

- Mouse-Look while holding the left mouse button
- WASD as usual
- Mouse wheel moves the camera forward/backward
- Holding the left mouse button and control, let's you strafe (also vertically)
- Camera is held upright (you can't do a backflip or a headstand)

2. Free Camera

- Mouse-Look while holding the left mouse button
- WASD let's you strafe (also vertically)
- Holding the left mouse button and control, let's you strafe (also vertically)
- Mouse wheel moves the camera forward/backward
- Q and E keys makes the camera roll

3. Orbiting

- You are always facing the centre point.
- The centre point is 0, 0, 0 by default (we will add other methods to set it eventually)
- Holding the left mouse button makes you rotate around the centre point while keeping the distance.
- WASD also makes you rotate around the centre point while keeping the distance.
- The mouse wheel moves you towards or away from the centre. But you can not pass through the centre.
- Q and E keys makes the camera roll
- Holding the left mouse button and control let's you strafe and moves the centre point in the same direction and by the same distance.

In all three modes you can hold down the shift key to perform actions at an accelerated speed.
User avatar
Okulo
Posts: 672
Joined: 05 Feb 2012, 16:11

Re: 3D scene: Navigation modes

Post by Okulo »

"Alternatives? Pah! Just implement them all!"

Nice, Zini. Very nice.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: 3D scene: Navigation modes

Post by sirherrbatka »

now we just need cells rendering :D
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: 3D scene: Navigation modes

Post by sirherrbatka »

@zini

wsad mode is problematic to me, because i'm using not a QWERTY layout. Can we add configuration for it?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 3D scene: Navigation modes

Post by Zini »

We could if we had a properly working user settings system (*cough*, *cough*). But that is still in a major revision, so that is a no for the time being.
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: 3D scene: Navigation modes

Post by Greendogo »

Can we add a navigation mode that doesn't use the scroll wheel? Imagine someone is working from a laptop without a mouse. Even laptops with scroll-capable trackpads sometimes have problems with them activating properly inside applications.

Ideally we could have mouse/key bindings for smoothly panning in and out and any other thing we'd currently use the mouse wheel for. The three navigational modes listed in Zini's post above just need an augmentation for panning in and out.

Can anyone else think of a better way to give people without a full mouse (no scroll wheel, no middle mouse button) full camera control in the editor?

I realize that the most productive way to do it is with a full mouse, with wheel, and this will be little more than a crutch, but I think people will be happy with some extra workarounds on this.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 3D scene: Navigation modes

Post by Zini »

Except for orbiting mode we already have the W and S keys. I guess we could add an additional pair of key bindings for orbiting mode. Please file a feature request on the back tracker.

As for no middle mouse, that will be aweful limiting. But we are going to make mouse buttons re-bindable.
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: 3D scene: Navigation modes

Post by Greendogo »

Zini wrote:As for no middle mouse, that will be awful limiting. But we are going to make mouse buttons re-bindable.
I believe that counts as a solution already.
Post Reply