Home Creators Posts Import Register Favorites Logout

Content

Check out the full video + extra screenshots on Dropbox 

I saw a video a while ago about vector fields and have wanted to experiment with them for a while. A vector field is a grid of arrows like this:

Each arrow represents a vector, which has a direction and a strength.

I then placed thousands of particles inside this grid, and moved them in the direction that the closest arrow is pointing. When a particle moves outside the grid, it's respawned at a random position inside the grid.

This creates some beautiful animations with pretty simple code:

GIFs may take a while to load

Multiple Fields

All the beauty lies in the velocity field generation code. I produced some funky results by overlaying multiple fields and blending them together.

The first field was a Curl field, which rotates particles around a point:

I then applied a Drift Field, which moves particles to the top-left:

Next was a Cos Field, which creates this ring-like pattern around a central point:

The last field is a Tan Field:

The final result is this futuristic-looking monstrosity:

High-quality videos and screenshots are available on Dropbox. The source code will be available to Optimiser Patrons soon.

Files

Comments

ToastedTortillas

Would these happen to be visuals of a Vector's Edge?

The Deep Well Uhmbali

You should use this to simulate flows of magic in a setting. You can create procedural rules for how that magic sticks to and interacts with things to see what pops up.

vercidium

That sounds awesome, kind of like Noita. I'd love to try this in a 3D space, or for a magic spell in a 2D game