How can i calculate angle based on movement in C# XNA when i'm moving object with accelerometer? If object is moving up, sprite would rotate in corresponding direction. Should i use two vector coordinates(old, new) to calculate angle using Atan2?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
Short answer: Yes. Slightly longer answer: Maybe you want to add the accelerometer input to the objects velocity variable, so that there are no very sudden movement changes, when the accelerometer fluctuates. Then you would use the current velocity to calculate the objects angle (still using |
|||
|
|