leozide / leocad

A CAD application for creating virtual LEGO models
https://www.leocad.org
2.42k stars 205 forks source link

FPS controls #165

Open posfan12 opened 6 years ago

posfan12 commented 6 years ago

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:

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!

Lewiscowles1986 commented 6 years ago

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.

posfan12 commented 6 years ago

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

Lewiscowles1986 commented 6 years ago

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.

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.

posfan12 commented 6 years ago

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.

j6t commented 3 years ago

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

Lewiscowles1986 commented 3 years ago

@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 commented 3 years ago

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

mjhorvath commented 3 years ago

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.

nathaneltitane commented 3 years ago

or when working on very complex mecha models

hendursaga commented 2 years ago

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

Lewiscowles1986 commented 2 years ago

@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.

nathaneltitane commented 2 years ago

image

Lewiscowles1986 commented 2 years ago

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

nathaneltitane commented 2 years ago

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

Lewiscowles1986 commented 2 years ago

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.

nathaneltitane commented 2 years ago

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...