Accelerometer

1 reply [Last post]
by: thrush
Status: Offline
Joined: 2011-11-02
Points: 480

Hi,

I am controlling the left right motion of my model in game by using Accelerometer on X, but the problem is that as game progresses, the sensitivity keeps on increasing, and then its really difficult to control.

I have done this -

velX = - (float) ((accX/20) * 2 * (current - movementTimer) ) /60000;
float xDiff;
xDiff = (velX);
x -= xDiff;

Can you please suggest what is wrong?

by: Greg Michael
Status: Offline
Joined: 2010-07-01
Points: 3630
Try sampling the

Try sampling the Accelerometer over several frames and take the average.

Latest Posts

Latest Comments

Top Contributors

  • Chris D : 27,010
  • MonRoyals : 26,970
  • Salman : 26,720
  • Jez Hammond : 20,130
  • pjan : 11,150
  • gjw : 10,350
  • Paolo Oliverio : 9,640
  • Beaker_2 : 8,390
  • Kite : 8,210
  • bluescrn : 7,810