, , , Swift. , SCNGeometryElement(indices:, primitiveType:) Swift 4, CInt, . , FixedWidthInteger, .. Int32. , , , .
:
let vertices = [
SCNVector3(x: 5, y: 4, z: 0),
SCNVector3(x: -5 , y: 4, z: 0),
SCNVector3(x: -5, y: -5, z: 0),
SCNVector3(x: 5, y: -5, z: 0)
]
let allPrimitives: [Int32] = [0, 1, 2, 0, 2, 3]
let vertexSource = SCNGeometrySource(vertices: vertices)
let element = SCNGeometryElement(indices: allPrimitives, primitiveType: .triangles)
let geometry = SCNGeometry(sources: [vertexSource], elements: [element])
SCNNode(geometry: geometry)
?
vertices, . allPrimitives , . vertices. , , . . vertices, , allPrimitives, , , , . SCNGeometry, SCNNode.
, . , . SCNGeometry, , .