We are trying to build a curve based off control points in multiple segments. We have a beginning segment for the first three control points, an end segment for the last three, and an entire middle with multiple segments of three. We are able to build a segment of a curve using the vertex command, but when we try to combine the segments together, the vertices do not connect in the correct order. Instead of the last point of the first segment connecting to the first point of the following segment and creating a curve, p5 is connecting the points in an incorrect order where it is drawing multiple straight lines.
https://editor.p5js.org/Ckagan1120/sketches/ZmC8S5idJ
Click 5 points on the canvas. You can turn down the curve resolution slider to get a clearer look at what is actually happening.
We recommend to click in a up and down, zig-zag kind of direction
Thanks in advance!!