FPS camera implementation

hello guys, does anyone of you have a good implementation of a FPS-like camera model, that he would share with the community?

i’ve tried implementing my own with java.awt.Robot to reset the mouse to the center, but whatever i try it always is so stuttery and laggy…

thanks for any help.

Here is a FPS camera implementation for gleem which I adapted from gleem’s FreeViewer. It limits pitch angle and rotates around the camera position rather than rotating around a given point.

Cheers,
Brett

I think he’s dealing with the problem that when the mouse hits the dge of the frame, the mouse-events stop, so he tries to correct it with the Robot.

You might want to try JInput (although I hear it is hardly documented) or simply switch to LWJGL that has this functionality built in (using JInput).

David Brackeen wrote a Java game programming book that I found very helpful. One of the first code examples that he gave was for an InputManager through AWT that provided the FPS style functionality. I cannot remember the name of the book off of the top of my head and my copy of InputManager is on a different computer (however it shant be hard to grab it, if you would want it). IMO it ran very smoothly and it used Robot to move the mouse back to the middle of the screen after every mouse event. Brackeen warned that the transparent cursor might flicker to show the true cursor, but I never noticed any problems with it.

It could be your computer, too, that has slow Robot code, so you could try another computer with you own implementation to see if that fixes everything.