rather than just moving a sphere across a plane, I want to make it roll like a ball. What is the simplest way of doing this? I assume it will have something to do with the circumference of the ball and rotating + moving it at a calculated rate.
What is the relevant maths here?
Answer
The simplest way is to calculate how much ball is moved and rotate the ball that much divided by it's radius!
And the reason: we all know how they calculate PI. imagine a circle with radius of one unit, it's perimeter is 2*PI as shown in this picture:
Now in your case the ball may move in any direction. but it's movement speed is always a 2d vector (note that it's rolling not flying!) and to rotate a ball you need a 2d vector. these 2d vectors have the same value except you need to divide speed vector by sphere diameter.
and as a sidenote, I've assumed that rotating the ball doesn't need any force. if you want a real physical simulation thing get a little more harder than this.
No comments:
Post a Comment