我想在p5.js中绘制一个带有webgl支持的四边形。我的代码如下所示在p5.js中绘制一个四边形webgl 3d
function setup() {
myCanvas = createCanvas(window.innerWidth,500,WEBGL);
myCanvas.parent('canvas');
}
function draw(){
background(255);
fill('blue');
beginShape();
vertex(-100,-100,20);
vertex(100,-100,20);
vertex(100,100,20);
vertex(-100,100,20);
endShape();
}
但我只得到一个三角形。是否有任何其他方式在p5.js
看起来这仍然是一个未解决的问题https://github.com/processing/p5.js/issues/1071 – Stedy