Name

bezierVertex()

Description

Specifies vertex coordinates for Bézier curves. Each call to bezierVertex() defines the position of two control points and one anchor point of a Bézier curve, adding a new segment to a line or shape. The first time bezierVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. This function must be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). Using the 3D version requires rendering with P3D (see the Environment reference for more information).

Examples

  • size(400,400);
    noFill();
    beginShape();
    vertex(120, 80);
    bezierVertex(320, 0, 320, 300, 120, 300);
    endShape();
    
    Image output for example 1
  • size(400,400);
    beginShape();
    vertex(120, 80);
    bezierVertex(320, 0, 320, 300, 90, 300);
    bezierVertex(200, 320, 240, 100, 120, 80);
    endShape();
    Image output for example 2

Syntax

  • bezierVertex(x2, y2, x3, y3, x4, y4)
  • bezierVertex(x2, y2, z2, x3, y3, z3, x4, y4, z4)

Parameters

  • x2(float)the x-coordinate of the 1st control point
  • y2(float)the y-coordinate of the 1st control point
  • z2(float)the z-coordinate of the 1st control point
  • x3(float)the x-coordinate of the 2nd control point
  • y3(float)the y-coordinate of the 2nd control point
  • z3(float)the z-coordinate of the 2nd control point
  • x4(float)the x-coordinate of the anchor point
  • y4(float)the y-coordinate of the anchor point
  • z4(float)the z-coordinate of the anchor point

Return

  • void