Generates a mesh in the shape of a right circular or elliptical cylinder.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Model I/O
The height of the cylinder along the y-axis.
The radii of the cylinder’s elliptical cross-section (in the x- and z-axis directions, respectively). If both radii are equal, this method generates a circular cylinder.
The number of points to generate around the horizontal circumference of the cylinder (that is, its cross-section in the xz-plane). A larger number of points increases rendering fidelity but decreases rendering performance.
The number of points to generate along the height of the cylinder. A larger number of points increases rendering fidelity but decreases rendering performance.
The type of geometric primitive from which to construct the mesh; must be MDLGeometryKindTriangles.
YESto generate normal vectors pointing toward the central axis of the cylinder;
NOto generate normal vectors pointing outward.
An object responsible for allocating mesh vertex data. If
nil, Model I/O uses an internal allocator object.
A new mesh object.
This method generates vertex data for a cylinder centered at the origin of its local coordinate system.
inward parameter determines the direction of generated vertex normal vectors for the mesh. Specify
YES if the mesh will be viewed from inside (for example, for use in a sky effect), or
NO if the mesh will be viewed from outside.
allocator parameter controls vertex data allocation for the mesh. For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering using Metal, pass a
MTKMesh object. By specifying an allocator, you can ensure that mesh data is copied a minimal number of times between being read from a file and being loaded into GPU memory for rendering.