Platforms to show: All Mac Windows Linux Cross-Platform
SCNGeometryElementMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
You use geometry elements together with SCNGeometrySourceMBS objects to define custom SCNGeometryMBS objects or to inspect the data that composes an existing geometry. You create a custom geometry using a three-step process:
1. Create one or more SCNGeometrySource objects, each of which defines per-vertex information such as position, surface normal, or texture coordinates for all vertices in the geometry.
2. Create at least one SCNGeometryElement object, containing an array of indices identifying vertices in the geometry sources and describing the drawing primitive that SceneKit uses to connect the vertices when rendering the geometry.
3. Create an SCNGeometry instance from the geometry sources and geometry elements.
When SceneKit renders a geometry, each geometry element corresponds to a drawing command sent to the GPU. Because different rendering states require separate drawing commands, you can define a geometry using multiple geometry elements. For example, the teapot geometry shown below has four geometry elements, so you can assign up to four SCNMaterial objects in order to render each element with a different appearance. But because each drawing command incurs a CPU time overhead when rendering, minimizing the number of elements in a custom geometry can improve rendering performance.
- 9 properties
- property bytesPerIndex as Integer
- property Data as MemoryBlock
- property Handle as Integer
- property maximumPointScreenSpaceRadius as Double
- property minimumPointScreenSpaceRadius as Double
- property pointSize as Double
- property primitiveCount as Integer
- property primitiveRange as NSRangeMBS
- property primitiveType as Integer
- method Constructor(data as MemoryBlock, PrimitiveType as Integer, primitiveCount as Integer, bytesPerIndex as Integer)
- shared method geometryElementWithData(data as MemoryBlock, PrimitiveType as Integer, primitiveCount as Integer, bytesPerIndex as Integer) as SCNGeometryElementMBS
- 5 constants
Primitive Types
Constant | Value | Description |
---|---|---|
PrimitiveTypeLine | 2 |
The geometry element’s data is a sequence of line segments, with each line segment described by two new vertices. |
PrimitiveTypePoint | 3 |
The geometry element’s data is a sequence of unconnected points. |
PrimitiveTypePolygon | 4 |
The geometry element’s data is a sequence of arbitrary polygons. see https://developer.apple.com/documentation/scenekit/scngeometryprimitivetype/scngeometryprimitivetypepolygon?language=objc |
PrimitiveTypeTriangles | 0 |
The geometry element’s data is a sequence of triangles, with each triangle described by three new vertices. |
PrimitiveTypeTriangleStrip | 1 |
The geometry element’s data is a sequence of triangles, with each triangle described by one new vertex and two vertices from the previous triangle. |
This class has no sub classes.
Some methods using this class:
- SCNGeometryMBS.geometryElementAtIndex(index as Integer) as SCNGeometryElementMBS
- SCNGeometryMBS.geometryElements as SCNGeometryElementMBS()
- SCNGeometryMBS.geometryWithSources(sources() as SCNGeometrySourceMBS, elements() as SCNGeometryElementMBS) as SCNGeometryMBS
Some properties using for this class:
- SCNGeometryMBS.edgeCreasesElement as SCNGeometryElementMBS
Some examples using this class:
Blog Entries
Release notes
- Version 19.3
- Added SCNGeometryElementMBS, SCNGeometrySourceMBS, SCNGeometryTessellatorMBS and SCNLevelOfDetailMBS classes for SceneKit.
The items on this page are in the following plugins: MBS Mac64bit Plugin.