xxxxxxxxxx
40
//Functions related to drawing not related to the curve
function drawControlPoints() {
stroke(255, 0, 255, 200); // Change the color
strokeWeight(10); // Make the points 10 pixels in size
for (let i = 0; i < pointArray.length; i++)
point(pointArray[i].x, pointArray[i].y);
}
function drawControlPointsLabel() {
stroke(200);
textSize(15);
strokeWeight(1);
noFill();
for (let i = 0; i < pointArray.length; i++)
text(i, pointArray[i].x, pointArray[i].y - 10);
}
function drawControlPolygon() {
noFill();
stroke('grey');
strokeWeight(3);
beginShape();
for (let i = 0; i < pointArray.length; i++)
vertex(pointArray[i].x, pointArray[i].y);
endShape();
}
function highlightpoint() {
stroke(255, 0, 0); // Change the color
strokeWeight(10);
if (weightpoint != -1)
point(pointArray[weightpoint].x, pointArray[weightpoint].y);
}