0

I want to make a roulette board with a ball spinning and landing on a certain field.

The catch is that the field the ball will land on, is known beforehand.

I want the animation to look somewhat realistic, even though the result is decided beforehand. So I think I need to calculate the path the ball will follow, starting from it's end position. However, in this case, it always needs to end up in the same starting position.

How can this be done?

Qqwy
  • 4,907

2 Answers2

3

program your wheel display with a sliding origin. Run the "spin down" algorithm without display, change the origin so the ball will stop on the right number. Run the spin-down algorithm again with display and real time delays.

ddyer
  • 4,078
1

I think you have the right idea - start from the desired end point & work backwards. You have at least 2 variables to play with - the initial speed of the ball & the initial speed of the wheel.

If you want to go nuts with this, remember you also have those diamond-shaped obstacles above the numbers on the wheel. As the ball starts to lose momentum & curve into the numbers, it'll often hit one of those obstacles & take a crazy bounce. That's a place where you can "adjust" the angle of the bounce & make it land where you want.

If you want to keep it simple, always start with the wheel in the same location & just make the (I forget - 34?) possible animations. Playback could be as simple as "show Spin00.gif".

Dan Pichelman
  • 13,853