www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: 32kda on May 28, 2012, 02:40:14 pm

Title: First Person Shooter like camera control with accelerometer
Post by: 32kda on May 28, 2012, 02:40:14 pm
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.
Title: Re: First Person Shooter like camera control with accelerometer
Post by: EgonOlsen 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: http://www.jpct.net/forum2/index.php/topic,1666.0.html (http://www.jpct.net/forum2/index.php/topic,1666.0.html)) and search the forum. You should be able to find something that is helpful.