Skip to content

Instantly share code, notes, and snippets.

int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
class MagneticField {
ArrayList<Moment> mmts = new ArrayList<Moment>(); // magnetic moments in the field
void addmmt(float mx,float my,float posx,float posy) {
mmts.add(new Moment(posx, posy, mx,my));
}
PVector getValue(float x,float y) {
PVector v = new PVector(0,0);
for (Moment mm : mmts) {
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
else
return 1 - 0.5 * pow(2*(1 - p), g);
}
class Center{
/*
float rad = height/3*sqrt(random(1));
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
class Center{
/*
float rad = height/3*sqrt(random(1));
float theta = random(TWO_PI);
float x = width/2 + rad*cos(theta);
float y = height/2 + rad*sin(theta);*/
float x = random(width);
float y = random(height);
float rot = random(-10,0);
color[] result;
PImage img;
PVector field(float x,float y,float t){
float amount = 100;
float scl = 0.01;
float scl2 = 0.005;
//--------------------------------------------------------------------------//
// Flow field animator by Etienne Jacob (www.necessary-disorder.tumblr.com) //
// Processing code (https://processing.org) //
// Saves frames, then you must use something else to make the GIF //
//--------------------------------------------------------------------------//
/// This code starts with the rendering system I took from @beesandbombs
/// (it also contains some useful functions and stuff)
/// You don't have to understand it
/// Just know that it does an average on many drawings to get a motion blur effect
/// from drawings parametrized by the global variable t going from 0 to 1