xxxxxxxxxx
25
function setup() {
createCanvas(800, 600, WEBGL);
angleMode(DEGREES);
}
function draw(){
background(200,200,0);
rotateY(90);
orbitControl();
let p0 = createVector(0, 20, 0);
let p1 = createVector(0, 0, 40);
let p2 = createVector(0, -60, 0);
let p3 = createVector(0, 0, -40);
beginShape();
fill(2);
stroke(0,0,200);
strokeWeight(2);
vertex(p0.x, p0.y, p0.z);
bezierVertex(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
bezierVertex(p2.x, p2.y, p2.z, p3.x, p3.y, p3.z, p0.x, p0.y, p0.z);
endShape(CLOSE);
}