leocad icon indicating copy to clipboard operation
leocad copied to clipboard

FPS controls

Open posfan12 opened this issue 7 years ago • 16 comments

I was wondering if you could implement (optional) FPS-style movement commands. FPS means "first-person shooter", which is a genre of video game.

These type of controls are divided into two things:

  • WASD controls: you move the camera/person forward, back and laterally using the W, A, S, D keys
  • mouselook: you aim the camera using the mouse, as if you were standing still or walking and aiming a gun

You already allow users to bind the WASD keys to movement, which is great! But the camera continues to "orbit" a point in space, instead of "pointing" in a direction. Further, aiming the camera up and down should be independent of movement. I mean, you should keep moving levelly, even if you are aiming up or down.

Do you understand what I am trying to explain? Thanks!

posfan12 avatar Jan 18 '18 07:01 posfan12

This could get confusing for users if the mouse were so free. There is a mode to allow rotation on one-or-more axis already, I think if you place a camera, you are able to alter the registration-point for movement as you describe.

Lewiscowles1986 avatar Jan 23 '18 16:01 Lewiscowles1986

"There is a mode to allow rotation on one-or-more axis already" Pleas elaborate on this. What mode is it?

posfan12 avatar Jan 23 '18 23:01 posfan12

Sure thing, so for bricks this different than to viewport. I'll show viewport here

rotate-camera

All I've done is placed a brick, split the viewports so I've got perspective, top, and a side view (it doesn't matter which side). Once that is done place a camera and set that up as a viewport. Then use the "rotate-view" which has it's tooltip showing. There will be a circle with four boxes showing.

  • The two on the left and right rotate fixed around the vertical axis.
  • The two at the top and bottom rotate fixed around the central horizontal axis
  • Going on the circle rotates around the depth axis (which I find strange)

Anywhere in the center is free, multi-axis rotation.

As I mentioned, it doesn't follow the mouse, because what would happen to the other viewports if it did?

Instead, you use the controls in the viewport you are in. An interesting thing about using it in the camera viewport is that it allows you to set a relative rotation-point (from the target, not the camera itself)

Hope this helps.

Lewiscowles1986 avatar Jan 24 '18 05:01 Lewiscowles1986

I did not know about the camera object. Thanks! But, still, I would like to (optionally) see the up and down camera rotation detached from movement direction, like in a video game.

posfan12 avatar Jan 28 '18 17:01 posfan12

LeoCAD is not a game. Is it really necessary to have FPS-like behavior?

j6t avatar Apr 17 '21 15:04 j6t

@j6t nobody wants it to be a video-game, the question is entirely about a control-style, supporting keyboard with forward, backward, strafe left and right, and rotation using the keyboard. It would be an accessibility win IMO, but it is also not easy. I did a spike back when I posted this. Probably should try another.

Lewiscowles1986 avatar Apr 18 '21 11:04 Lewiscowles1986

PS: The free camera rotation, was something I did not look into. I'm not sure how confusing that could be.

Lewiscowles1986 avatar Apr 18 '21 11:04 Lewiscowles1986

When building a model of a car you likely wouldn't want to use this. But it could be useful for adding internal details to a large and complex building for instance. Or a broad sprawling area where the vertical axis is not very important.

mjhorvath avatar Apr 20 '21 03:04 mjhorvath

or when working on very complex mecha models

nathaneltitane avatar Apr 20 '21 03:04 nathaneltitane

Would this perhaps be a duplicate of https://github.com/leozide/leocad/issues/443?

hendursaga avatar Jan 01 '22 20:01 hendursaga

@hendursaga #443 would be a duplicate of this wouldn't it, as 443 is a higher number than 165... Not sure where that was going.

Lewiscowles1986 avatar Jan 01 '22 21:01 Lewiscowles1986

image

nathaneltitane avatar Feb 01 '22 19:02 nathaneltitane

This is not Solidworks. Is there more to this than the image also embedded elsewhere? Perhaps some text about the screengrab might communicate some internal detail?

FPS does not rotate the world, it rotates a specific camera looking at the world. LeoCad is not an FPS. It could be nice to have keyboard controls; but I agree with @j6t that this is not a game. Or solidworks or the other software mentioned on #368

Lewiscowles1986 avatar Feb 02 '22 04:02 Lewiscowles1986

This is not Solidworks. Is there more to this than the image also embedded elsewhere? Perhaps some text about the screengrab might communicate some internal detail?

FPS does not rotate the world, it rotates a specific camera looking at the world. LeoCad is not an FPS. It could be nice to have keyboard controls; but I agree with @j6t that this is not a game. Or solidworks or the other software mentioned on #368

was merely referncing existing instances of a similar implementation to what the OP requested.

technicalities are beyond me...

would be nice to have though

nathaneltitane avatar Feb 02 '22 04:02 nathaneltitane

Right, but can you provide details of what it is you like about the software. You're asking for a lot, and giving very little detail.

I Assume there is more detail in your head than this picture of what you are looking for.

Some of the things you have described are entirely separate to this issue. I'm just trying to get you to communicate those details; and consider if they should be in a different place.

Lewiscowles1986 avatar Feb 02 '22 07:02 Lewiscowles1986

Right, but can you provide details of what it is you like about the software. You're asking for a lot, and giving very little detail.

I Assume there is more detail in your head than this picture of what you are looking for.

Some of the things you have described are entirely separate to this issue. I'm just trying to get you to communicate those details; and consider if they should be in a different place.

well, again referencing ldview as I've had my fair share of experience with it regarding model viewing and analysis:

keyboard arrow keys are mapped in such way that the model is always the center focus of the main camea and pressing right, turns the the camera right, while keeping the model centered (giving a turntable effect of sorts) and etc with all other direction arrows...

If you already use Leocad, no harm installing LDview as you probably have your LDraw library already setu up...test it out quickly, you'll understand...

nathaneltitane avatar Feb 02 '22 14:02 nathaneltitane