Using ApplyForce to simulate wind

In my game I am working on the user controls the wind with the mouse. They move the mouse pointer to the location they want the wind to blow from and then they click and hold the left mouse button to make the wind blow. The wind is used to blow a small ball around the screen. The wind power should taper off as the distance between the wind and the ball increases.

I am having trouble with Box2D's ApplyForce function because I don't know what to pass into it in order to make the ball move in the correct direction. Also, I was wondering if someone could point me in the right direction on how to make the wind less powerful as the distance from wind to ball increases.

Thanks in advance,
lobo235
Since you know where the player clicks the mouse, you can create a vector at that point, then use the vector for the ball's position and subract the two, that gives you a vector between them. Take that vector's length and that will give you the distance from the wind source to the object, or alternatively.. for the wind source just use whatever position you are giving the wind generator( if its an on screen fan for instance ).

Finally, take the direction vector you get from the players selection and normalize it( there are built in functions for that and in case you don't know what it means, it just means making it a vector in the same direction but with a length of 1. )
then you can multiply it by some value you derive from the distance and you have a strength.

Original thread: https://box2d.org/forum/viewtopic.php?t=2184