Stops adding shapes to a new p5.Geometry object and returns the object.
The beginGeometry() and endGeometry() functions help with creating complex 3D shapes from simpler ones such as sphere(). beginGeometry() begins adding shapes to a custom p5.Geometry object and endGeometry() stops adding them.
beginGeometry() and endGeometry() can help to make sketches more performant. For example, if a complex 3D shape doesn’t change while a sketch runs, then it can be created with beginGeometry() and endGeometry(). Creating a p5.Geometry object once and then drawing it will run faster than repeatedly drawing the individual pieces.
See buildGeometry() for another way to build 3D shapes.
Note: endGeometry() can only be used in WebGL mode.
Examples
Returns
p5.Geometry: new 3D shape.
This page is generated from the comments in src/webgl/3d_primitives.js . Please feel free to edit it and submit a pull request!