quadraticVertex

Static quadraticVertex 

Source
pub static quadraticVertex: QuadraticVertexInternalType
Expand description

Specifies vertex coordinates for quadratic Bezier curves. Each call to quadraticVertex() defines the position of one control points and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time quadraticVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. For WebGL mode quadraticVertex() can be used in 2D as well as 3D mode. 2D mode expects 4 parameters, while 3D mode expects 6 parameters (including z coordinates).

This function must be used between beginShape() and endShape() and only when there is no MODE or POINTS parameter specified to beginShape().

Examples

strokeWeight(5);
point(20, 20);
point(80, 20);
point(50, 50);

noFill();
strokeWeight(1);
beginShape();
vertex(20, 20);
quadraticVertex(80, 20, 50, 50);
endShape();
strokeWeight(5);
point(20, 20);
point(80, 20);
point(50, 50);

point(20, 80);
point(80, 80);
point(80, 60);

noFill();
strokeWeight(1);
beginShape();
vertex(20, 20);
quadraticVertex(80, 20, 50, 50);
quadraticVertex(20, 80, 80, 80);
vertex(80, 60);
endShape();

Overloads

cx x-coordinate for the control point

cy y-coordinate for the control point

x3 x-coordinate for the anchor point

y3 y-coordinate for the anchor point


cx x-coordinate for the control point

cy y-coordinate for the control point

cz z-coordinate for the control point (for WebGL mode)

x3 x-coordinate for the anchor point

y3 y-coordinate for the anchor point

z3 z-coordinate for the anchor point (for WebGL mode)