xxxxxxxxxx
56
//declare our variables
let p1x = 300;
let p1y = 150;
let p2x = 68;
let p2y = 19;
let p3x = 50;
let p3y = 75;
let p4x = 32;
let p4y = 91;
let whateverwewant = 60;
function setup() {
createCanvas(400, 150);
}
function draw() {
background(220);
strokeWeight(10);
//shape 1
strokeWeight(5);
point(p1x, p1y); //point1
point(p2x, p2y);//point2
point(p3x, p3y);//point3
point(p4x, p4y);//point4
point(p1x, p1y);//point5
strokeWeight(1);
noFill();
beginShape();
curveVertex(p4x, p4y); //The first and last points in a series of curveVertex() lines will be used to guide the beginning and end of the curve.
curveVertex(p1x, p1y);//point1
curveVertex(p2x, p2y);//point2
curveVertex(p3x, p3y);//point3
curveVertex(p4x, p4y);//point4
curveVertex(p1x, p1y);//point5
curveVertex(p2x, p2y); //The first and last points in a series of curveVertex() lines will be used to guide the beginning and end of the curve.
endShape();
}