you can treat wind as a force, like gravity.

Please log in or register to post a reply.

Quick and dirty way: just add wind’s velocity.

More realistic way: compute the surface the object is offering to the wind (a simple square, or maybe a real projection), and estimate the force resulting from the wind pushing this surface considering the wind as a pressure (F=PS if I recall correct). Then F=ma :-) The real problem is to get a nice P=f(Vwind) function.

Physically based way: implement some Ph.D thesis about fluid dynamics. ;-)

yes treat it as a force not a velocity

also treat the gravity as a force not acceleration and treat them as vectors not scalar values.

Wind in itself is not a force, it just the velocity of air particles. What pushes your object is friction, which is relative to the wind’s velocity. If your object is moving along the direction of the wind, but slower, the wind makes your object moving faster. But if your object is moving faster than the wind, things are reversed: air resistance causes your object to slow down up until it has the same velocity as the wind.

So what you should do is incorporate air friction in your calculations. Calculate the relative wind direction by subtracting your object’s velocity from the wind velocity. This is the direction of the force, which you should multiply by a constant which describes how much air friction influinces your object. Divide this vector by the mass of the object to get the acceleration (F=m*a => a=F/m)

@mmakrzem

I’ve created some objects that have the following attributes:

a = acceleration

v = velocity

p = position

t = delta timeRight now, I am doing the following:

v += (a + gravity) * t;

p += v * t;How do I incorporate wind? Lets say that I have a wind velocity = w. where would I put it in my equations?

I was thinking of doing this:

v += (a + gravity + w) * t;but I don’t think this is right, because wind is not an acceleration…. it is a velocity.

So then I was thinking maybe:

v += (a + gravity) * t + w;but because t is not constant then w does not change the velocity in a nice fasion.

What is the correct way to handle wind speed?

Well, for starters, your equations are just the simple kinematic equations, so no rigid body involved here. So, a wind you could treat just like a force applied from some direction. It would be a bit more involved in rigid body sim, but you would simplify and treat wind as a resistance force or just a directional force. Simulating it like a fluid mechanics problem would be … overkill ;-) In a car racing sim, you would model wind resistance, but treat it mostly uniform like a frictional force, and maybe a little more involvement, but you really don’t need much more complex modelling like this for a game, it will be realistic enough to believe it. Last, to get a more ‘windy’ feel, you could randomly perturb the wind force amount at times, like from hard to mild, none to tornado blast, etc…. just modulate the amount of pressure force the wind is putting on the object.

[EDIT]

Let me clarify by force, it would just become a velocity on the object,
disregarding mass since it’s a particle you wind up

x = x0 + (v+wind_vx)*t

y = y0 + (v+wind_vy)*t - 0.5*g*t*t

And wind is a velocity in some direction. I just ignore the mass of the
particle so the force ends up being a linear accel which than becomes

a constant applied to velocity …. but, that is not very rigorous, but
it *works* in a video game sim.

- Upcoming Multiplatform Game Program...
- Our first game - looking for feedbacks
- Network Emulation Tool
- Trouble with accessing GLSL array
- Fiction
- Game Programming Patterns: Bytecode
- Interactive WebGL Water Demo
- Skeletal Animation Tutorial with GP...
- Unreal Engine 4
- Microsoft xbox one selling poorly

I’ve created some objects that have the following attributes:

a = acceleration

v = velocity

p = position

t = delta time

Right now, I am doing the following:

v += (a + gravity) * t;

p += v * t;

How do I incorporate wind? Lets say that I have a wind velocity = w. where would I put it in my equations?

I was thinking of doing this:

v += (a + gravity + w) * t;

but I don’t think this is right, because wind is not an acceleration…. it is a velocity.

So then I was thinking maybe:

v += (a + gravity) * t + w;

but because t is not constant then w does not change the velocity in a nice fasion.

What is the correct way to handle wind speed?