Type Method

newIcosahedronWithRadius:inwardNormals:allocator:

Generates a mesh in the shape of a regular 20-sided polyhedron with triangular faces.

Declaration

+ (instancetype)newIcosahedronWithRadius:(float)radius inwardNormals:(BOOL)inwardNormals allocator:(id<MDLMeshBufferAllocator>)allocator;

Parameters

radius

The distance from the icosahedron’s center to any one of its vertices.

inwardNormals

YES to generate normal vectors pointing toward the center of the icosahedron; NO to generate normal vectors pointing outward.

allocator

An object responsible for allocating mesh vertex data. If nil, Model I/O uses an internal allocator object.

Return Value

A new mesh object.

Discussion

This method generates vertex data for an icosahedron centered at the origin of its local coordinate system. An icosahedron is a rough approximation of a sphere—to generate a more precise approximation, create an icosahedron and use the newSubdividedMesh:submeshIndex:subdivisionLevels: method to turn it into a geodesic sphere.

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.

See Also

Creating Parametric Meshes

+ newBoxWithDimensions:segments:geometryType:inwardNormals:allocator:

Creates a mesh in the shape of a rectangular box or cube.

+ newCylinderWithHeight:radii:radialSegments:verticalSegments:geometryType:inwardNormals:allocator:

Generates a mesh in the shape of a right circular or elliptical cylinder.

+ newPlaneWithDimensions:segments:geometryType:allocator:

Generates a mesh in the shape of a rectangular plane.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software