class Hair { float angle = 0.0; float root_offset = random(0,1); float radius = width * 0.015; RPoint anchor; Perlin ctrl_a; Perlin ctrl_b; Perlin target; Hair(RPoint pt, float angle) { this.angle = angle + random(-0.1, 0.1); anchor = new RPoint(pt.x, pt.y); // 0/3 ctrl_a = new Perlin(0, -(radius/3), (radius/6)); // 1/3 ctrl_b = new Perlin(0, -(radius/3)*2, (radius/3)); // 2/3 target = new Perlin(0, -radius-random(radius/2), (radius/3)*2); // 3/3 } void update() { ctrl_a.update(0.039); ctrl_b.update(0.035); target.update(0.032); } void draw() { update(); noFill(); strokeWeight(1); stroke(255-bg,127); pushMatrix(); translate(anchor.x, anchor.y); rotate(angle); bezier(0, root_offset, ctrl_a.pt.x, ctrl_a.pt.y, ctrl_b.pt.x, ctrl_b.pt.y, target.pt.x, target.pt.y); popMatrix(); } }