Hey all, still working to incorporate more physics simulation into my game (mentioned HERE). Now having the ball successfully and quite realistically bouncing a surface it hits, I wanted to make the ball spin off.
Now this seemed simple enough, I would calculate the rotation speed for the ball every time-tick and then rotate the ball by that much degrees upon drawing.
I knew that the speed of rotation would depend, upon impact, on:
- Initial Speed of the ball hitting the surface (magnitude of ball velocity vector)
- Friction co-efficient of ball & surface (constants for simulation)
- Angle between ball impact velocity vector and the surface normal (approximated by dot vector value of impact and exit velocity vectors. 1 meaning high spin, -1 meaning no spin, and everything else relatively in between)
so, multiplying all of the above together, and making sure they were then transformed to the range 0-1, and multiplied by Max rotation speed, the ball seemed to respond in rotation speed as was expected. Except for one thing, it was always rotating clock-wise (because of positive values)
So my question is this:
- What do you think of my method? I know it is not the most accurate, but it is good enough for simple simulation. Any easier ones?
- If this method is fine, then what am I missing? How should I know when ball should rotate clock/anti-clock wise?
thanks for any comments