Hey! raylib forum is closing!

After a year with not much movement in the forum I decided to close it.

The cost of maintaining the hosting is a bit high for the usage of the platform, updating the forum and managing it is also a bit cumbersome and the truth is that I'm already trying to maintain multiple other networks pretty more active than this forum.

I'll recommend you to move to the other raylib networks:

- For a forum style, use Reddit: https://www.reddit.com/r/raylib/
- For direct messaging and questions, use Discord: https://discord.gg/VkzNHUE
- To report issues, use GitHub: https://github.com/raysan5/raylib

- Also, remember you can contact me personally on Twitter: https://twitter.com/raysan5 or directly by mail to ray[at]raylib.com

If you feel generous, you can also contribute to the project on my Patreon: https://www.patreon.com/raylib

Thanks to you all for joining the project and help to improve it with your questions. Keep it up! :)

Best Regards,


PD. Closing will be effective by October 31th.

"Infinite" mouse position - 3D Camera


I am actually playing with 3D, and I decided to update the camera by myself, trying to avoid the camera modes provided by raylib, in order to learn, as always.

My problem is that when I rotate my camera around the "player", using the mouse, the location is limited at my screen (monitor) bounds.

I am not sure about how should I fix it. I have taken a look at camera.c, I have probably skiped something, but well, I am stuck with it.

I hope you can help me ^^



  • I supose you want to make a orbit camera. To make it, you should not use directly the current mouse position to update the orbit camera position.

    You should have a Vector2 to know the current orbit position to calculate it and update these values calculating a deltaPosition (how much the mouse was moved since last frame?). Then, you can apply a smooth when update these values...

    Using this method you can handle a orbit camera without considering screen size...

    I hope I help you a little bit
  • Hello fisac,
    Thanks for your answer. My problem is that the mouse reaches the monitor bound, so the mouse can't be moved anymore in the bound direction, which means that the current mouse position is the same than the previous frame mouse position. What I am wanting to do is to keep the mouse position in the middle of the raylibs window or make it "infinite" (When the mouse reaches the left bound, it moves to the right bound).

    The question seems to be more stupid with every word I write xD. I am going to take a look at camera.c again, I must be missing something.

  • Hello MarcMDE! In case you haven't found the answer yet. The key is the function: SetMousePosition(Vector2 position);
    It resets the mouse position to the center of the screen if it goes out of bounds! ;)
Sign In or Register to comment.