I have created a shape using beginShape, endShape and curveVertex. My code looks like that:
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
strokeWeight(5);
point(84, 91);
point(68, 19);
point(21, 17);
point(32, 91);
strokeWeight(1);
fill(0); // HOW TO FILL WITH IMAGE
beginShape();
curveVertex(84, 91);
curveVertex(84, 91);
curveVertex(68, 19);
curveVertex(21, 17);
curveVertex(32, 91);
curveVertex(32, 91);
endShape(CLOSE);
}
Instead of filling shape with a color, I want to fill it with an image. Is it possible with P5.js?