Parameters

The radii of the cone’s elliptical cross-section (in the x- and z-axis directions, respectively). If both radii are equal, this method generates a circular cone.

radialSegments

The number of points to generate around the horizontal circumference of the cone (that is, its cross-section in the xz-plane). A larger number of points increases rendering fidelity but decreases rendering performance.

verticalSegments

The number of points to generate along the height of the cone. A larger number of points increases rendering fidelity but decreases rendering performance.

geometryType

The type of geometric primitive from which to construct the mesh; must be MDLGeometryKindTriangles.

inwardNormals

YES to generate normal vectors pointing toward the central axis of the cone; NO to generate normal vectors pointing outward.

Return Value

A new mesh object.

Discussion

This method generates vertex data for a cone whose apex is at the origin of its local coordinate system and whose body extends in the negative y-axis direction.

The inwardNormals 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.

The 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 MTKMeshBufferAllocator 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.