Sun
cloud cloud cloud cloud cloudcloud cloud cloud cloud cloudcloud cloud cloud cloud cloudcloud cloud cloud cloud cloud

Zandgall.com

Welcome to the site!

A resource for Arvopia and other projects

Vector Fields

Vector Fields are a very fun little subject that can have a variety of uses. A lot of the time it is used in simulating, but in our case it will be used for artistic purposes.

This is an example of a vector field, however in a more standard vector field there will be different sizes to each line, giving them a different impact on particles. But that's getting ahead of myself.

A vector field is a set of vectors (unbelievable I'm sure) that usually form based on a specific pattern or path. Each vector is spaced equally from a vector to it's right, it's left, and the top and bottom, in a grid-like fashion.

Using a vector field is as simple as putting a particle in it, and having the particle accelerate depending on how the vector field tells it to. If it's directly on a vector pointing to the right, the particle will accellerate to the right, however if it is directly in the middle between a vector pointing right, and a vector pointing left (both the same magnitude), it will not accelerate at all.

Sounding simple yet? Don't worry, it get's worse. This usage of vector fields (known more commonly, as "flow fields") is used in some smaller yet complicated simulations like visualizing magnetic fields, or pathfinding. But it can also be used in big big major projects like Fluid Simulation and Aerodynamics.

Fortunately for us, we don't need all this big tech physics magic. We just want to make something that looks cool. So all we really have to do, is drop in a bunch of particles with certain settings.

This is how my program's option menu looks. Most of the options are self explanatory, such as Particle Opacity, Particle Size, Particle Amount, Particle Speed, and Color Variety (as well as the color selector at the bottom). However, there's a few that might need some explanation.

Blending, is a little similar to a "motion blur" effect. It draws a rectangle that's completely black, with a certain opacity based on "blending", making everything fade out over time. Update speed is only effective to "Noise Field" (more on that later), changing the field over time. Rand Variation, makes particles go to any random position, higher values making it happen more often. Field Cells changes how large a "cell" is, or how much space a vector takes up.

The Reset button clears the screen and starts drawing particles again. The Debug button shows particles and vectors similar to the first two screenshots at the top of the page. And the last slider changes what type of generation is used to make a vector field.

The vector field types are as follows. A Noise field, like a smoothly random generation. Gravity, just pulling particles towards the center of the screen. Rotation, everything orbiting the center of the screen. Strand, a strange generation with everything being pushed around quite frequently. Mouse repel is everything being pushed away from the mouse, Mouse Attract is things pulled towards the ouse, Mouse Orbit is everything orbiting around the mouse.

Mouse Path will point a vector in the direction that the mouse is moving, if the mouse if hovered over it.

This game was actually based on another project that I made, here on this website. You can check it out here.

Vector Field.zip - 10MB

Home