Hello Guest

Mouse DX/DY alternates between high and low values

  • 3 Replies
  • 8434 Views
Mouse DX/DY alternates between high and low values
« on: July 20, 2012, 11:03:35 »
Upon implementing a first person camera, I noticed some jitteryness when using the mouse for turning/looking. I tried printing out the mouse's DX in each frame and noticed something odd. When the mouse was moving at an approximately steady speed in real life, what was reported in the printout was something like this:

219, 160, 252, 171, 273, 177, 267, 167 and so on.

These are the successive DX's in each frame. Notice how they alternate between high and low values. This general pattern happens every time I run the program and at all times within each run. I have checked that the same time elapses between the successive DX's. The same thing happens with different mice. But all of the mice work fine while playing other fps games on the same computer. Is this a bug in LWJGL or is there something else that I'm missing?

Thanks.

Edit: I should add that the same thing happens with the DY's.

Re: Mouse DX/DY alternates between high and low values
« Reply #1 on: July 20, 2012, 12:04:30 »
Out of curiosity I tried commenting out Display.sync() and the feed looked like that.

Re: Mouse DX/DY alternates between high and low values
« Reply #2 on: July 20, 2012, 12:24:14 »
Out of curiosity I tried commenting out Display.sync() and the feed looked like that.

Thanks, but I haven't commented it out and my feed looks like that.

*

Offline princec

  • *****
  • 1933
    • Puppygames
Re: Mouse DX/DY alternates between high and low values
« Reply #3 on: July 20, 2012, 16:06:58 »
This may be related to an ongoing discussion about issues with getDX/DY on Windows which causes it to be unreliably jittery. See here.

Cas :)