A three-dimensional shape (also called a model or mesh) that can be displayed in a scene, with attached materials that define its appearance.
SDKs
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Scene
Kit
Declaration
class SCNGeometry : NSObject
Overview
In SceneKit, geometries attached to SCNNode
objects form the visible elements of a scene, and SCNMaterial
objects attached to a geometry determine its appearance.
Working with Geometry Objects
You control a geometry’s appearance in a scene with nodes and materials. A geometry object provides only the form of a visible object rendered by SceneKit. You specify color and texture for a geometry’s surface, control how it responds to light, and add special effects by attaching materials (for details, see the methods in Managing a Geometry’s Materials). You position and orient a geometry in a scene by attaching it to an SCNNode
object. Multiple nodes can reference the same geometry object, allowing it to appear at different positions in a scene.
You can easily copy geometries and change their materials. A geometry object manages the association between immutable vertex data and a mutable assignment of materials. To make a geometry appear more than once in the same scene with a different set of materials, use its inherited copy()
method. The copy shares the underlying vertex data of the original, but can be assigned materials independently. You can thus make many copies of a geometry without incurring a significant cost to rendering performance.
You can animate a geometry object. The vertex data associated with a geometry is immutable, but SceneKit provides several ways to animate geometry. You can use a SCNMorpher
or SCNSkinner
object to deform a geometry’s surface, or run animations created in an external 3D authoring tool and loaded from a scene file. You can also use methods in the SCNShadable
protocol to add custom GLSL shader programs that alter SceneKit’s rendering of a geometry.
Obtaining a Geometry Object
SceneKit provides several ways to introduce geometry objects to your app:
Action | For further information |
---|---|
Load from a scene file created using external 3D authoring tools | |
Use and customize SceneKit’s built-in primitive shapes |
|
Create 3D geometry from 2D text or Bézier curves | |
Create a custom geometry from vertex data |
|