Quote:

I was wondering can this simulate a Tornado?




The script is more of a gust/calm simulation than anything else. You can have it blow in one direction or blow from north and then to the south. Lots of randomness built in.

The only way I can think of to "fake" a tornado would be to constantly change the direction. The relevent part would be this:

Code:
  
var d_direction_min[3] = -1,0,0; // currently set to W
var d_direction_max[3] = -1,0,0; // currently set to W
/* DIRECTIONS ARE INTO THE CARDINAL DIRECTION(i.e. north wind is blowing towards north)
0, 1, 0 north
0,-1, 0 south
-1, 0, 0 west
1, 0, 0 east */



The "Z" is never used, so you'd need to change the "X" and "Y" to correspond to the appropriate cardinal direction. Start out with the initial value and then when the time between changes expires, you change the X/Y to the appropriate value(0, 1, or -1). Both the _min and _max would need to be the same value since that insures the wind will always blow in that one direction. If they are different, it will blow from one extreme to the other, though maybe that would give it some chaotic personality.

The only problem is is that the wind isn't really like that in a tornado. It isn't cyclonic, it's blowing in a given direction. Maybe if you the rate of change was really fast it would be good enough for games.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links