Generic Initializer


Creates a geometry element from the specified array of index values.


convenience init<IndexType>(indices: [IndexType], primitiveType: SCNGeometryPrimitiveType) where IndexType : FixedWidthInteger



An array of index values, each of which identifies a vertex in a geometry source.


The drawing primitive that connects vertices when rendering the geometry element. For possible values, see SCNGeometryPrimitiveType.

Return Value

A new geometry element object.


SceneKit connects the vertices in the order specified by the indices array, arranged according to the primitiveType parameter.This initializer is equivalent to the init(data:primitiveType:primitiveCount:bytesPerIndex:) initializer, but does not require an intermediary Data object; instead, it automatically infers the necessary allocation size and bytesPerIndex values based on the contents of the indices array.

To create a custom SCNGeometry object from the geometry element, use the init(sources:elements:) initializer.

See Also

Creating a Geometry Element

init(mdlSubmesh: MDLSubmesh)

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