Creates a mesh from the specified SceneKit geometry, using the specified allocator.
- iOS 10.0+
- macOS 10.12+
- tvOS 10.0+
A SceneKit geometry object.
An object responsible for allocating mesh vertex data. If
nil, Model I/O uses an internal allocator object.
A new mesh object.
SceneKit is a high-level framework for modeling, animating, and displaying 3D scenes. (For details, see SceneKit.) The
SCNGeometry class describes a source of vertex data for rendering a single 3D object, and contains both a set of geometry elements (
SCNGeometry objects) that describe index data and a set of material assignments that describe rendering appearance information.
In Model I/O, a
MDLMesh object represents both a mesh’s geometry and (as a
MDLObject subclass) its position and orientation in a scene. In SceneKit, an
SCNGeometry object represents only the geometry, and the
SCNNode object containing a geometry contains location and orientation information. To also import location and orientation, import the geometry’s containing node as a
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.