[SDL] mouse look

Alan Wolfe atrix2 at cox.net
Fri Feb 20 12:02:00 PST 2004


wow thats quite involved, thanks for the info

----- Original Message ----- 
From: "David Olofson" <david at olofson.net>
To: <sdl at libsdl.org>
Sent: Friday, February 20, 2004 11:40 AM
Subject: Re: [SDL] mouse look


> On Friday 20 February 2004 19.46, Alan Wolfe wrote:
> > hello, i was wondering what the propper way to do mouse look was?
> >
> > right now every frame im getting the position of the mouse,
> > subtracting the midpoint of the screen from the mouse position,
> > multiplying X and Y by a constant, rotating my camera by those
> > numbers, then warping the mouse back to the middle of the screen.
> >
> > Ive had reports from high end systems that mouse look is acting as
> > though they are getting really low fps - that its really jumpy
> > instead of smooth, but they are reporting 60fps so this doesnt make
> > sense to me since thats the same fps i get.
> 
> That might be a result of an event handling problem, or simply that 
> the mouse has a very low frame rate. Serial mice and even some PS/2 
> mice can be limited to anything from ~15 through 50 fps, which means 
> you just won't get smooth mouselook without some tricks.
> 
> Try interpolating or filtering the mouse events before you feed them 
> to the 3D engine. That's what the "smooth mouse" option found in many 
> 3D games does. That should give you smooth animation, but the bad 
> news is that it adds control latency.
> 
> Basically, if the mouse frame rate is the problem, the only real 
> solution is to replace the mouse and/or configure it properly. Most 
> drivers have some way of setting the frame rate, and many PS/2 and 
> USB mice (at least the Logitech ones) can be configured to at least 
> 100 Hz.
> 
> 
> > Is there a better way to do mouse look?
> 
> Only if you're on a platform that supports relative mouse move events 
> without screen clamping. Doesn't help the mouse frame rate, though.
> 
> 
> //David Olofson - Programmer, Composer, Open Source Advocate
> 
> .- Audiality -----------------------------------------------.
> |  Free/Open Source audio engine for games and multimedia.  |
> | MIDI, modular synthesis, real time effects, scripting,... |
> `-----------------------------------> http://audiality.org -'
>    --- http://olofson.net --- http://www.reologica.se ---
> 
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list