@@ -688,8 +688,8 @@ function vertex(p5, fn){
688
688
} ;
689
689
690
690
/**
691
- * Begins adding vertices to a custom shape.
692
- *
691
+ * Concludes the vertices of a custom shape.
692
+ *
693
693
* The <a href="#/p5/beginShape">beginShape()</a> and `endShape()` functions
694
694
* allow for creating custom shapes in 2D or 3D.
695
695
* <a href="#/p5/beginShape">beginShape()</a> begins adding vertices to a
@@ -698,7 +698,9 @@ function vertex(p5, fn){
698
698
* The first parameter, `mode`, is optional. By default, the first and last
699
699
* vertices of a shape aren't connected. If the constant `CLOSE` is passed, as
700
700
* in `endShape(CLOSE)`, then the first and last vertices will be connected.
701
+ * When CLOSE mode is used for splines (with `splineVeertex()`), the shape is ended smoothly.
701
702
*
703
+ *
702
704
* The second parameter, `count`, is also optional. In WebGL mode, it’s more
703
705
* efficient to draw many copies of the same shape using a technique called
704
706
* <a href="https://webglfundamentals.org/webgl/lessons/webgl-instanced-drawing.html" target="_blank">instancing</a>.
@@ -759,6 +761,28 @@ function vertex(p5, fn){
759
761
* }
760
762
* </code>
761
763
* </div>
764
+ *
765
+ * <div>
766
+ * <code>
767
+ * function setup() {
768
+ * createCanvas(100, 100);
769
+ * background(200);
770
+ *
771
+ * beginShape();
772
+ *
773
+ * splineVertex(32, 91);
774
+ * splineVertex(21, 17);
775
+ * splineVertex(68, 19);
776
+ * splineVertex(82, 91);
777
+ *
778
+ * endShape(CLOSE);
779
+ *
780
+ * describe(
781
+ * 'A curvy four-sided slightly lopsided blob.'
782
+ * );
783
+ * }
784
+ * </div>
785
+ * </code>
762
786
*
763
787
* <div>
764
788
* <code>
0 commit comments