Author Topic: First Person Shooter like camera control with accelerometer  (Read 3972 times)

Offline 32kda

  • byte
  • *
  • Posts: 10
    • View Profile
Hi Guys.
I'm trying to wite simple shooting game using jpct-AE. Thought about making view/aim control with the accelerometer, by rotating camera to some angle after turning the device around some (x or y) axis, like it's done in some racing games.

But I can't get a logics of accelerometer values and camera rotation angles, looking right-left works OK (used cam.rotateCameraY), but trying to add up-down looking using rotateCameraX goofs camera navigation, camera begins to rotate strangely.

Can you please give a link for some sample code for such navigation or explain how to do that.
Best regards, D.A.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
Re: First Person Shooter like camera control with accelerometer
« Reply #1 on: May 28, 2012, 09:00:06 pm »
A few thread deal with this. Just a have a look at the stickies (like this one:,1666.0.html) and search the forum. You should be able to find something that is helpful.