class FlowField { PVector[][] field; int cols, rows; int resolution; FlowField(int r_) { resolution= r_; cols = width/resolution; rows = height/ resolution; field = new PVector[cols][rows]; init(); } void init() { noiseSeed((int)random(10000)); noiseDetail(5,0.75); float xoff =0; for (int i = 0; i < cols; i++) { float yoff = 0; for (int j=0;j