@@ -31,17 +31,28 @@ description: >
31
31
32
32
<a href="/reference/p5/endShape">endShape()</a> in order to draw a curve:</p>
33
33
34
- <p>
35
- <code>beginShape();</code><br>
36
- <code>// Add the first control point.</code><br>
37
- <code>curveVertex(84, 91);</code><br>
38
- <code>// Add the anchor points to draw between.</code><br>
39
- <code>curveVertex(68, 19);</code><br>
40
- <code>curveVertex(21, 17);</code><br>
41
- <code>// Add the second control point.</code><br>
42
- <code>curveVertex(32, 91);</code><br>
43
- <code>endShape();</code><br>
44
- </p>
34
+ <pre><code>beginShape();
35
+
36
+
37
+ // Add the first control point.
38
+
39
+ curveVertex(84, 91);
40
+
41
+
42
+ // Add the anchor points to draw between.
43
+
44
+ curveVertex(68, 19);
45
+
46
+ curveVertex(21, 17);
47
+
48
+
49
+ // Add the second control point.
50
+
51
+ curveVertex(32, 91);
52
+
53
+
54
+ endShape();
55
+ </code></pre>
45
56
46
57
<p>The code snippet above would only draw the curve between the anchor points,
47
58
@@ -52,20 +63,35 @@ description: >
52
63
53
64
<code>curveVertex()</code> with the coordinates of the control points:</p>
54
65
55
- <p>
56
- <code>beginShape();</code><br>
57
- <code>// Add the first control point and draw a segment to it.</code><br>
58
- <code>curveVertex(84, 91);</code><br>
59
- <code>curveVertex(84, 91);</code><br>
60
- <code>// Add the anchor points to draw between.</code><br>
61
- <code>curveVertex(68, 19);</code><br>
62
- <code>curveVertex(21, 17);</code><br>
63
- <code>// Add the second control point.</code><br>
64
- <code>curveVertex(32, 91);</code><br>
65
- <code>// Uncomment the next line to draw the segment to the second control point.</code><br>
66
- <code>// curveVertex(32, 91);</code><br>
67
- <code>endShape();</code><br>
68
- </p>
66
+ <pre><code>beginShape();
67
+
68
+
69
+ // Add the first control point and draw a segment to it.
70
+
71
+ curveVertex(84, 91);
72
+
73
+ curveVertex(84, 91);
74
+
75
+
76
+ // Add the anchor points to draw between.
77
+
78
+ curveVertex(68, 19);
79
+
80
+ curveVertex(21, 17);
81
+
82
+
83
+ // Add the second control point.
84
+
85
+ curveVertex(32, 91);
86
+
87
+
88
+ // Uncomment the next line to draw the segment to the second control point.
89
+
90
+ // curveVertex(32, 91);
91
+
92
+
93
+ endShape();
94
+ </code></pre>
69
95
70
96
<p>The first two parameters, <code>x</code> and <code>y</code>, set the
71
97
vertex’s location. For
0 commit comments