Type Method

geometryElementWithMDLSubmesh:

Creates a geometry element from the specified Model I/O submesh object.

Declaration

+ (instancetype)geometryElementWithMDLSubmesh:(MDLSubmesh *)mdlSubMesh;

Parameters

mdlSubmesh

A Model I/O submesh object.

Return Value

A new geometry element.

Discussion

The Model I/O framework provides universal support for import, export, description, and processing of several 3D asset file formats and related resources. (For details, see Model I/O.) The MDLSubmesh class is a generic description of an index buffer to be used in rendering a 3D object, along with an assigned material.

In SceneKit, materials are assigned to a geometry rather than to its elements, so importing a submesh as a geometry element does not import its material assignment. To import a Model I/O mesh along with its materials, use the SCNGeometry geometryWithMDLMesh: method.

See Also

Creating a Geometry Element

+ geometryElementWithData:primitiveType:primitiveCount:bytesPerIndex:

Creates a geometry element from the specified data and options.