Platforms to show: All Mac Windows Linux Cross-Platform
Back to SCNGeometryMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
This method creates a geometry with no visible content. You can use an empty geometry with another geometry’s levelsOfDetail property to make the geometry disappear when it is too far away from the camera to usefully render.
SceneKit’s SCNGeometryMBS subclasses use this method to create geometry instances with default contents. For example, if you call this method on the SCNSphereMBS class, it creates a sphere geometry whose radius property has the default value of 0.5.
You cannot add geometry sources or elements to a geometry object after creating it. To create a custom geometry from your own source and element data, use the geometryWithSources method.
SCNGeometryMBS.copy as SCNGeometryMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
SCNGeometryMBS.geometryElementAtIndex(index as Integer) as SCNGeometryElementMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Each SCNGeometryElementMBS object describes how vertices from the geometry’s sources are combined into polygons to create the geometry’s shape. Visible geometries contain at least one element.
SCNGeometryMBS.geometryElements as SCNGeometryElementMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Each SCNGeometryElementMBS object describes how vertices from the geometry’s sources are combined into polygons to create the geometry’s shape. Visible geometries contain at least one element.
For geometries with multiple elements, you can use the materials property to attach different materials to each element.
SCNGeometryMBS.geometrySources as SCNGeometrySourceMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Each SCNGeometrySourceMBS object describes an attribute of all vertices in the geometry (such as vertex position, surface normal vector, color, or texture mapping coordinates) identified by the source’s semantic property. A geometry always has at least one source (for the SCNGeometrySourceSemanticVertex semantic), typically has additional sources for use in lighting and shading, and may have other sources for skeletal animation or surface subdivision information.
SCNGeometryMBS.geometrySourcesForSemantic(semantic as String) as SCNGeometrySourceMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
semantic: A constant identifying a semantic for which to return geometry sources. See Geometry Semantic Identifiers for possible values.
Returns an array of SCNGeometrySource objects, or nil if the geometry has no source for the specified semantic.
Each SCNGeometrySourceMBS object describes an attribute of all vertices in the geometry (such as vertex position, surface normal vector, color, or texture mapping coordinates) identified by the source’s semantic property. A geometry always has at least one source, for the SCNGeometrySourceSemanticVertex semantic, typically has additional sources for use in lighting and shading, and may have other sources for skeletal animation or surface subdivision information.
The vertex, normal, and color semantics each refer to at most one source. A geometry may have multiple sources for the SCNGeometrySourceSemanticTexcoord semantic—in this case, indices in the returned array correspond to values for the mappingChannel property used when attaching textures to materials.
SCNGeometryMBS.insertMaterial(Material as SCNMaterialMBS, Index as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
material: The material to insert.
index: Index in the materials array to insert the new material.
SCNGeometryMBS.levelsOfDetail as SCNLevelOfDetailMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Because rendering a complex geometry incurs a performance cost, you can use level-of-detail objects to substitute simpler geometries in its place as its distance from the point of view camera increases (or its apparent size decreases). For details, see SCNLevelOfDetailMBS.
SCNGeometryMBS.materials as SCNMaterialMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Each geometry element can be rendered using a different material. The index of the material used for a geometry element is equal to the index of that element modulo the number of materials.
SCNGeometryMBS.materialWithName(name as string) as SCNMaterialMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
name: The name of the material to retrieve.
SCNGeometryMBS.removeMaterial(Index as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
index: The index of the material to remove from the 'materials' array.
SCNGeometryMBS.replaceMaterial(Index as Integer, Material as SCNMaterialMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
index: The index of the material to replace in the materials array.
material: The new material that will replace the previous one.
SCNGeometryMBS.setLevelsOfDetail(LevelsOfDetails() as SCNLevelOfDetailMBS = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Value can be nil to clear it.
SCNGeometryMBS.setMaterials(materials() as SCNMaterialMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Some examples using this method:
The items on this page are in the following plugins: MBS Mac64bit Plugin.
