# slot machine physics

This topic is 4882 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does anyone have any ideas for programming the physics of the reels spinning on a 3d slot machine? Basically, I need a function that produces an angle of rotation given the current time. Eventually, the angle of rotation needs to end up at a multiple of 45 degrees (because I have 8 items on each reel and I want them to be aligned right when the spin is thru). mike http://www.coolgroups.com/

##### Share on other sites
Quote:
 Original post by mike74Does anyone have any ideas for programming the physics of the reels spinning on a 3d slot machine? Basically, I need a function that produces an angle of rotation given the current time. Eventually, the angle of rotation needs to end up at a multiple of 45 degrees (because I have 8 items on each reel and I want them to be aligned right when the spin is thru).mikehttp://www.coolgroups.com/

This is a simple application of a well-known kinematics formula. Use

θ(t) = ω · t

where ω is the angular velocity of the reel. To get this in increments of 45 degrees, use θ*(t) = θ(t)/2π - floor[θ(t)/2π] * θ(t)/2π. Then multiply the result by 2π/8 to get a number in the range [0, 7]. Multiply the integral value by 45 degrees to get the final position.

##### Share on other sites
If there are eight faces then there are 16 stop positions. I believe with a modern slot machine the electronics determines the outcome and motors produce it. The only nearly random part is the electronics selecting an outcome. The spinning of the reels is just a show to entertain the player.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634088
• Total Posts
3015449
×