# simple vortex field

3 replies to this topic

### #1empy_85

New Member

• Members
• 4 posts

Posted 10 December 2010 - 12:20 AM

hi everybody,
i m jus working on opengl particles..
i need to create a vortex field ..
can anybody shed some idea that how to make the vortex field for the particle............

### #2Reedbeta

DevMaster Staff

• 5309 posts
• LocationSanta Clara, CA

Posted 10 December 2010 - 12:25 AM

Make the particles travel in circles around a central axis, with a speed that is high close to the axis and slow far from it.
reedbeta.com - developer blog, OpenGL demos, and other projects

### #3TheNut

Senior Member

• Moderators
• 1701 posts
• LocationCyberspace

Posted 10 December 2010 - 01:51 AM

Spirals
Gravity

Depending on your vortex, those two topics should help you get started on your vortex simulator. If you're interested in just creating a cloud vortex like a hurricane, then create a spiral and populate the arm with a lot of particles. As Reedbeta stated, rotate the particles closest to the centre quicker than those further away. You can use the inverse-square law to determine how fast the particles move in relation to its distance from the centre.

If by vortex you're talking about wormholes, blackholes, or similar things, then you could add a little more realism by introducing gravity into your simulator. Depending on how you want the effect to look, start off with an explosion of particles on the spiral and with an initial force equal to the tangent of the spirals arm. If you use a weak force, the particle will get drawn into the well. If you use a strong force, it will slingshot. You can calculate the escape velocity if you want it to orbit the well. Then just let physics do the rest. Rotate the spiral so newly created particles appear to be rotating with the vortex. Add more than one spiral if you want a more nauseous animation. Add warping and shearing effects in a fragment shader to really get that "Ohhhh" and "Ahhhh" effect :)
http://www.nutty.ca - Being a nut has its advantages.

### #4empy_85

New Member

• Members
• 4 posts

Posted 10 December 2010 - 09:42 AM

TheNut said:

Spirals
Gravity

Depending on your vortex, those two topics should help you get started on your vortex simulator. If you're interested in just creating a cloud vortex like a hurricane, then create a spiral and populate the arm with a lot of particles. As Reedbeta stated, rotate the particles closest to the centre quicker than those further away. You can use the inverse-square law to determine how fast the particles move in relation to its distance from the centre.

If by vortex you're talking about wormholes, blackholes, or similar things, then you could add a little more realism by introducing gravity into your simulator. Depending on how you want the effect to look, start off with an explosion of particles on the spiral and with an initial force equal to the tangent of the spirals arm. If you use a weak force, the particle will get drawn into the well. If you use a strong force, it will slingshot. You can calculate the escape velocity if you want it to orbit the well. Then just let physics do the rest. Rotate the spiral so newly created particles appear to be rotating with the vortex. Add more than one spiral if you want a more nauseous animation. Add warping and shearing effects in a fragment shader to really get that "Ohhhh" and "Ahhhh" effect :)

YAA THANK UREED BETA AND NUT..
THANK U SO MUCH...

#### 1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users