Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[camera] Camera look initial mouse position #1628

Closed
chriscamacho opened this issue Mar 3, 2021 · 3 comments
Closed

[camera] Camera look initial mouse position #1628

chriscamacho opened this issue Mar 3, 2021 · 3 comments

Comments

@chriscamacho
Copy link
Contributor

  • [ X ] I tested it on latest raylib version from master branch
  • [ X ] I checked there is no similar issue already reported
  • [ ? ] My code has no errors or misuse of raylib

Issue description

If the mouse position is set to the centre of the screen before the main loop starts, I would expect that
the 3d camera view would be looking down the Z axis

I believe this to be caused by the fact that the previous mouse position is initialised to 0,0 not the centre of the screen. (UpdateCamera)

Having said that using SetMousePosition followed by UpdateCamera several times before the main loop does not work...

Environment

Multiple Linux distros, multiple GL versions on different GPU's

Issue Screenshot

TODO insert picture of camera view looking at an odd angle

Code Example

TODO there's probably an existing raylib example i can add SetMousePosition to just before the main loop

NB in a rush will do the TODO's later if they are really needed...

@raysan5
Copy link
Owner

raysan5 commented Mar 18, 2021

Current camera system implementation should be redone from scratch.

@chriscamacho
Copy link
Contributor Author

from memory I think you've said this before, to be honest as it is such a fundemental I think it needs to be properly spec'd out before any work starts

exactly how should it behave ?, what should and should be parametrised etc

@raysan5
Copy link
Owner

raysan5 commented Mar 19, 2021

I'm linking this issue to #1143 and closing, they are related.

About the initial mouse position, yes, that's an issue with UpdateCamera(), it's not considering initial camera parameters properly.

@raysan5 raysan5 closed this as completed Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants