Full 360 Accelerometer Rotation Question

Hey guys,
So I am working on a game and I want the actor to be able to turn all 360 degrees based on the accelerometer position. (meaning its rotation can be anywhere from 0-360 degrees) Can I do this with one simple equation or will I have to configure individual equations based on different accelerometer positions?
Any help appreciated
Thanks,
-Matt
So I am working on a game and I want the actor to be able to turn all 360 degrees based on the accelerometer position. (meaning its rotation can be anywhere from 0-360 degrees) Can I do this with one simple equation or will I have to configure individual equations based on different accelerometer positions?
Any help appreciated
Thanks,
-Matt
Comments
make a game level attribute: accelAngle (real)
In a timer:
Change Attribute: accelAngle To:(vectorToAngle(game.Accelerometer.X,game.Accelerometer.Y)+90)%360
The "+90" is for landscape mode ( change as necessary)
The %360 is to make sure accelAngle does not end up higher than 360 (especially if 90 degrees gets added to it.)
Yes -- sort of. In an actor put the following constrain behavior:
Constrain attribute: (self.Rotation) To: (vectorToAngle(game.Accelerometer.X,game.Accelerometer.Y)-90)%360)
Its a little jerky doing it that way but it might do.