A six-sided polyhedron geometry whose faces are all rectangles, optionally with rounded edges and corners.
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Define the shape of the box in the x-, y-, and z-axis dimensions of its local coordinate space by setting its
length properties. Add rounded edges and corners to a box with its
chamfer property. To position and orient a box in a scene, attach it to the
geometry property of an
Control the level of detail with the
chamfer properties. A higher segment count produces more vertices, which can improve rendering quality for certain lighting models or custom shader effects, but at a cost to rendering performance.
You can assign up to six
SCNMaterial instances to a box—one for each side—with its
materials property. The
SCNBox class automatically creates
SCNGeometry objects as needed to handle the number of materials.