Examples Geometries

Geometries

p5’s WEBGL mode includes 7 primitive shapes. Those shapes are plane, box, cylinder, cone, torus, sphere, and ellipsoid. Additionally, model() displays a custom geometry loaded via loadModel(). This example includes each of the primitive shapes. It also includes a model from NASA’s collection.

Creative Commons BY-NC-SA license badge

Geometries: Revised by Caleb Foss. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!