Enumeration Case

SCNGeometryPrimitiveTypePolygon

The geometry element’s data is a sequence of arbitrary polygons.

Declaration

SCNGeometryPrimitiveTypePolygon = 4

Discussion

The element’s data property holds two sequences of values.

  • The first sequence has a number of values equal to the geometry element’s primitiveCount value. Each value in this sequence specifies the number of vertices in a polygon primitive. For example, if the first sequence is [5, 3], the geometry element contains a pentagon followed by a triangle.

  • The rest of the data is a sequence of vertex indices. Each entry in the first sequence specifies a corresponding number of entries in the second sequence. For example, if the first sequence includes the values [5, 3], the second sequence includes five indices for the pentagon, followed by three indices for the triangle.

Figure 1 shows an example sequence and (assuming a corresponding geometry source) a possible arrangement of the vertices it identifies.

Figure 1

Element data for polygon primitives