Monday, October 17, 2016

mathematics - make a sphere rolling on a roulette mesh stop at predetermined place


I have a roulette and a ball(sphere) placed on it. When the game begins the roulette spins. The spinning of the roulette and gravitational forces on the ball makes it roll along the 3d roulette mesh.


Now , in this roulette game of mine I have slots from 00 to 36. I want to make sure that after the roulette stops spinning the ball comes and stops rolling at my predetermined slot.


For example : if i set the target slot as 25 in the game, every time the roulette spins, the ball moves realistically along with it BUT comes slowly to a stop at slot no: 25.



enter image description here


I have tried 'slerp' the ball to its target position, but the realism is lost. The ball moves through the mesh. Which i don't want. I want the ball to roll like in real life.



Answer



Script one (or two or three) bouncing paths for the ball to follow. Adjust the rotation of your wheel model to cause the correct slot to land underneath the ball's final destination.


A bouncing path: construct complex animations made from many small movements of the ball over time, such that it appears to be natural physical motion around the structure of the wheel. Eventually, that animation will end with the ball settling into a slot and rotating at the same speed as the wheel. That location does not need to be changed, because the wheel can be rotated such that the correct slot is underneath the ball. One method for scripting these paths is to follow keyframes based on a spline.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...