vertex(x, y, [xLeftHandle], [yLeftHandle], [xRightHandle], [yRightHandle])

Shapes are constructed by connecting a series of vertices. vertex() is used to specify the vertex coordinates of lines and polygons. It is used exclusively between the beginShape() and endShape() functions.

Use either vertex(x, y) for drawing straight corners or vertex(x, y, xLeftHandle, yLeftHandle, xRightHandle, yRightHandle) for drawing bezier shapes. You can also mix the two approaches.

Type: function

Parameter(s):

  • x {Number}:

    X-coordinate of the vertex.

  • y {Number}:

    Y-coordinate of the vertex.

  • xLeftHandle {Number} Optional:

    X-coordinate of the left-direction point.

  • yLeftHandle {Number} Optional:

    Y-coordinate of the left-direction point.

  • xRightHandle {Number} Optional:

    X-coordinate of the right-direction point.

  • yRightHandle {Number} Optional:

    Y-coordinate of the right-direction point.