Butterfly/bat
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
let t = frameCount / 5
let a = sin(t / 7) * 0.05 + sin(t) * 0.05 + 0.1
noStroke()
fill(200, 200, 100, 150)
translate(200 + sin(sin(t / 4) / 2 + t / 10) * 5, 200 - sin(t / 3) ** 2 * 10)
scale(2)
rotate(-PI / 2 - a)
for (let i = 0; i < 2; i ++) {
push()
translate(-66, 66)
beginClip({invert: true})
circle(-25, -25, 100)
endClip()
beginClip({invert: true})
circle(25, 25, 100)
endClip()
beginClip()
circle(-25, -25, 200)
endClip()
beginClip()
circle(25, 25, 200)
endClip()
circle(50, -50, 200)
pop()
rotate(PI / 2 + a * 2)
}
}(Originally seen at https://editor.p5js.org/bojidar-bg/sketches/3Ol5RThJ_)
Browse more articles?
← Scribbler Experiments tagged p5 (56/85) Sling →
← Gear face Experiments tagged critter (4/6) Musical Critter →
← Scribbler Experiments on this site (56/85) Sling →