An object that manages smooth transitions between a node's base geometry and one or more target geometries.
- iOS 8.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
You control these transitions by associating an
SCNMorpher object with a node using its
morpher property. The morpher maintains an array of target geometries and a set of weights associated with each. When all weights are zero, the surface takes the form of the base geometry (from the node’s
geometry property). When you use the
set method to increase a weight to
1, the surface takes the form of the geometry at the corresponding index in the morpher’s
targets array. If you use a variety of weight values for several targets, the surface takes a form that proportionally interpolates between the target geometries.
You can also animate weights implicitly or explicitly using keypath animations. For example, the following code creates a morph animation that transitions one target weight back and forth repeatedly:
A morpher and its target geometries may be loaded from a scene file or created programmatically. The base geometry and all target geometries must be topologically identical—that is, they must contain the same number and structural arrangement of vertices.