tags:

views:

277

answers:

2

Hi All,

I am developing a part of game in which i need to move the ball in a circle. I am able to move the ball in circle with the help of Accelerometer. Problem is when there is collision on the edge. At that point the ball does not move smoothly as when there is no collision.

There are jerks when moving the ball, so my question is how to tackle with this situation. Is there any algo to move the object in circular path smoothly using Accelerometer. Moving the object, detecting collisions in straight path is no issue.I did that already.

Help is needed in URGENT.

A: 

Can you tell me how you move the ball in circles with accelerometer? I know how to move it like that without the accelerometer.

Thanks in advance

A: 

one way to do it is ofcourse to get the angleof rotationa bout the circle from x and y of accelerometer. Sorry for digressing.

Hi Jagan, I used Section formula to move the ball in and on the edge of the circle. Using Section formula i am able to find if the ball is moving out of the specified circle radius. If it is moving out of the desired radius i am using Section formula to find the point which is very close to the point which is out of the circle. This will give me the new point in or on the circle which is what i desired.
Vishal Mali