I want to model simple lottery machine, it has got a bottom blower.
Do you know how can I get force applied to object above blower by air from blower, or equations to model this behavior?
Red arrow is blower "wind"
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
In all cases, you will need a fluid simulation. However, there are several methods available out there, and the proper solution will depend on various parameters:
I suggest you start by reading Josh Stam’s Stable Fluids. It will probably not give you the immediate answer, but it will give you an idea of where to start. You should also check out computational fluid dynamics software implementations.
Since one of the major phenomenons causing the random result is turbulence, I would suggest going for a large eddy simulation.
I would suggest you utilize a physics engine, such as Bullet. It will save you a lot of work in the long run.
That said, if you want to get started writing your own physics simulation from scratch, you may want to check out the series of articles from Glenn Fiedler's blog that start here.
Use the Drag Equation with velocity varying as a function of distance from the blower. You might also introduce extra variability by varying the entire velocity field in a random (or periodic) way as a function of time.
You'll need to simulate standard collision dynamics for the balls as well (this is what produces the complex mixing).
As far as selecting which ball goes up the tube when the slot is opened, you'll mostly just pick the one closest to the internal end of the tube.
A - the cross sectional area of the sphere (pi*r^2)
rho (looks like 'p') - 1.22521 kg/m^3 (Density of Air, sea level, room temp)
C - 0.47 (Drag coefficient of a sphere)