dmarkwick 261 Posted July 5, 2007 Anyone know how to return the strength of the current wind? As a lot of people here may know, I'm a-workin' on a smoke addon problem is, when it looks good in still weather it looks crap in windy weather, & vice-versa. So I want to make 2 of the parameters reactive to the wind strength. If I can make the particle rate increase when it's windy then it will look good when it's blowing away, but I need to reduce the particle lifetime accordingly. Likewise if i there's no wind I can drop the particle rate and increase the particle lifetime to get good tall smoke columns. So whatever the weather I can maintain a balance between good effects & number of particles. But first I need a way to get the current wind strength Share this post Link to post Share on other sites
Nutty_101 0 Posted July 5, 2007 Wiki: Wind Returns a three position array [X,Y,Z?] X/Y are the direction/how fast the wind is moving and Z might be thermals?? Got me. Just what i think it is. Share this post Link to post Share on other sites
fasad 1 Posted July 5, 2007 Z would likely be the vertical component of the wind vector. All the vectors are in meters per second. I'm under the impression particles just move with a constant velocity, right? If so, the best solution would simply be to add the wind vector to the smoke particles velocity, which means you don't need the total strength. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">smokeParticle setVelocity [(velocity smokeParticle select 0) + (wind select 0), ... ] Share this post Link to post Share on other sites
dmarkwick 261 Posted July 5, 2007 LOL, thanks guys if I'd just looked under "W" for wind I would have seen it, but I only looked under "G" for GetWind never thought it would be so simple. Cheers again. *edit* In order for me to use the above array usefully, I just need to multiply each array element by 1 right? to turn any negative values into positives? Share this post Link to post Share on other sites
fasad 1 Posted July 5, 2007 Nope, just add whatever the current wind vector element is, even if that element is negative. Share this post Link to post Share on other sites
dmarkwick 261 Posted July 5, 2007 Nope, just add whatever the current wind vector element is, even if that element is negative. Aah, I think I may have missed out an explanation I just need the vector strength, not it's directional component. I intend to just use the first 2 array elements to get a general wind strength so I can affect particle lifetime and particle creation rate whatever the direction is is unimportant at this stage. Share this post Link to post Share on other sites
t_d 47 Posted July 5, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_strength = SQRT((wind select 0)^2 + (wind select 1)^2); Share this post Link to post Share on other sites
fasad 1 Posted July 5, 2007 Oh, okay. In that case you have two options : pythag or trig. I don't know which is more efficient, which may be important for lots of smoke. Any programmer should be able to tell you that, or you might need to test it. I'd ditch the Z component, it's generally very small. pythag (roughly - ignoring the wind's Z component) : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">windSpeed = sqrt (((wind select 0)*(wind select 0)) + ((wind select 1)*(wind select 1))) result in m/s. pythag (precise with more calculations due to including the Z component) : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">windSpeed = sqrt ( ( (wind select 0)*(wind select 0) ) + ( (wind select 1)*(wind select 1) ) + ( (wind select 2)*(wind select 2) ) ) result in m/s. trig (rough - no Z) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">windSpeed = (wind select 1) / cos ((wind select 0) atan2 (wind select 1)) trig (precise - with Z) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">windSpeed = (wind select 2) / ( cos ((wind select 1) / cos ((wind select 0) atan2 (wind select 1)) atan2 (wind select 2) ) ) disclaimer - probably some mistakes in there : ) Share this post Link to post Share on other sites
dmarkwick 261 Posted July 5, 2007 Thanks guys, looks like you both gave me the same answer I'll use it. Performance shouldn't be an issue as I'll do the check every 2 minutes or so. Again, thanks Share this post Link to post Share on other sites
dmarkwick 261 Posted July 5, 2007 Part II: I can't find any information about wind in ArmA, does anyone know what the min & max parameters are? Setting the weather seems to have very little (if any) influence on the wind speed, which seems to be entirely arbitrary. Share this post Link to post Share on other sites
Nutty_101 0 Posted July 6, 2007 Don't really know, the most i have seen is almost 7 on X and 4 on Y with Z being 0.000214 or something like that at all times. Would be interesting to know what the limits are. Share this post Link to post Share on other sites
celery 8 Posted July 6, 2007 I want a command that sets the wind direction and strength. Share this post Link to post Share on other sites