Is bezierVertex() broken in WEBGL mode?

The following code generates the error message "p5.js:16790 Uncaught vertex() must be used once before calling bezierVertex()"

var s = function(p) {

    p.setup = function() {
        p.createCanvas(500, 500, p.WEBGL);
        p.stroke(0); 
        p.fill(150);
    }

    p.draw = function() {
        p.background(255);
        p.beginShape();
        p.vertex(30, 20, 0);
        p.bezierVertex(80, 0, 80, 75, 30, 75);
        p.bezierVertex(50, 80, 60, 25, 30, 20);
        p.endShape();
    }
}

var myp5 = new p5(s);

Answers

Sign In or Register to comment.