Bowling planet
I'm somehow fond of this particular two-dimensional manner of drawing planets.
(The bowling ball holes are only subconsciously inspired by XKCD What If #46.)
function setup() {
createCanvas(400, 400);
}
function draw() {
background("#121212");
randomSeed(34)
noStroke()
fill("#fff")
for (let i = 0; i < 30; i ++) {
let a = random(2 * PI)
let d = random(170, 250)
circle(200 + cos(a) * d, 200 + sin(a) * d, 5)
}
push()
beginClip({ invert: true }) // Bowling ball (':
circle(230, 220, 50)
circle(210, 270, 50)
circle(264, 264, 50)
endClip()
beginClip()
circle(200, 200, 300)
endClip()
background("#2B85B1")
blendMode(ADD)
fill(255, 20)
circle(200-20, 200-20, 300-20)
blendMode(BLEND)
push()
beginClip()
rect(250, 90, 400, 45, 10)
rect(200, 120, 400, 45, 10)
rect(260, 210, 400, 45, 10)
rect(280, 240, 400, 45, 10)
rect(300, 270, 400, 45, 10)
rect(-280, 90, 400, 45, 10)
rect(-250, 120, 400, 45, 10)
rect(-270, 150, 400, 45, 10)
rect(-350, 180, 400, 45, 10)
rect(-300, 240, 400, 45, 10)
rect(-285, 270, 400, 45, 10)
rect(-290, 300, 400, 45, 10)
endClip()
background("#17C736")
blendMode(ADD)
fill(255, 10)
circle(200-20, 200-20, 300-40)
blendMode(BLEND)
pop()
push()
beginClip()
rect(100, 20, 200, 45)
rect(100, 335, 200, 45)
endClip()
background("#E6F1F0")
blendMode(ADD)
fill(255, 10)
circle(200-20, 200-20, 300-0)
blendMode(BLEND)
pop()
pop()
}(Originally seen at https://editor.p5js.org/bojidar-bg/sketches/PU-WI3qsI)
Browse more articles?
← Shiny Sphere Experiments tagged p5 (48/85) Particle automata →
← Gear face Experiments tagged silly (2/3) Morphing grid →
← Shiny Sphere Experiments on this site (48/85) Particle automata →