如何更改 p5js 3d 几何图形的填充

How to change the fill of p5js 3d Geometries

这些是几何图形: http://p5js.org/examples/examples/3D_Geometries.php

我已经尝试过 2d 形状的语法,但它似乎不起作用。 WEBGL 形状是否有特殊的语法,或者颜色可以不改变吗?

使用ambientMaterial(color);,你必须将它与灯光一起使用才能看到结果。

查看此页面以获取解释:https://github.com/processing/p5.js/wiki/Getting-started-with-WebGL-in-p5#lights-and-materials