xxxxxxxxxx
69
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
strokeWeight(1)
stroke('lightgrey')
for(var x=0;x<=400;x+=20)
{
line(x,0,x,400)
line(0,x,400,x)
}
text("X: " + mouseX + " Y: " + mouseY, 100,20)
stroke('black')
fill(0,0,0,100)
strokeWeight(5)
beginShape()
vertex(80,120)
vertex(110,100)
vertex(140,120)
vertex(170,100)
vertex(200,120)
vertex(200,180)
vertex(80,180)
endShape(CLOSE)
push()
translate(140,0)
beginShape()
curveVertex(80,120)
curveVertex(80,120)
curveVertex(110,100)
curveVertex(140,120)
curveVertex(170,100)
curveVertex(200,120)
curveVertex(200,180)
curveVertex(80,180)
endShape(CLOSE)
pop()
push()
translate(30,140)
beginShape()
vertex(80,120)
vertex(80,120)
vertex(110,100)
vertex(140,120)
vertex(170,100)
vertex(170,100)
endShape()
pop()
push()
translate(140,140)
beginShape()
curveVertex(80,120)
curveVertex(80,120)
curveVertex(110,100)
curveVertex(140,120)
curveVertex(170,100)
curveVertex(170,100)
endShape()
pop()
}