Tornado


Class : Tornado.h

Made By : Craig

Uses : GL_LINES

Complexity : MEDIUM

Creates a conical helix using parametric equations that simulate a tornado.

For the tornado effect each particle is given a t value. This value is used within the parametric equations which represent the coordinates of a particle in 3 space. Particles are drawn as a series of lines (some shifted above, some below). As well some particles are randomly assigned a negative value to 'flip' the helix and better define the tornado structure.

The tornado is utilized with the Tornado class. It is initialized with :

Tornado t = new Tornado (int MAX_DUST, vector3f coord, vector3f radius);

The constructor asks the user to specify the maximum number of dust particles (drawn as a series of lines), middle coordinates of the box, and its dimensions (radius). Since the tornado uses the box model, it is drawn with :

t -> drawTornado();

... and it's surrounding box drawn with :

t -> drawBox();

As with any of the line-based effects, GL_LIGHTING must be disabled before making the call to the drawing method. The input values for editing are somewhat sensitive as they affect the parametric equations of the helix :

  • TRadius : This value determines the radius of the tornado funnel. A higher value creates a smaller tornado size.
  • Speed : The speed determines how fast the tornado will revolve (how fast the t value will increase around the conical helix).

Thoughts : This class took a lot of time to figure out. I first created it using textured quads that would revolve around the helix structure. This was problematic as the quads did not rotate as they travelled around, thus on the edges the would "disappear". I then decided to scrap that and go with a lines structure. This worked out well and seems to give a good effect for the tornado.