A sphere (or ball or globe) geometry.

SDKs

- iOS 8.0+
- macOS 10.8+
- tvOS 9.0+
- watchOS 2.0+

Framework

- SceneKit

## Overview

A sphere defines a surface whose every point is equidistant from its center, which is placed at the origin of its local coordinate space. You define the size of the sphere in all three dimensions using its `radius`

property.

SceneKit approximates the curved surface of a sphere using a mesh of polygons. There are two options for constructing the mesh:

By default, SceneKit constructs the sphere using a rectangular grid, like the lines of latitude and longitude on a globe of the Earth. The sphere has a vertex at each pole, and its

`segment`

property determines both the number of divisions along its surface from one pole to the other (or lines of latitude) and the number of divisions around its circumference in a horizontal plane (or lines of longitude).Count If you set the sphere’s

`is`

property toGeodesic `true`

, SceneKit constructs the sphere by successively subdividing the triangular surfaces of a regular icosahedron. For a geodesic sphere, the`SCNSphere`

property scales logarithmically to determine the number of subdivisions, roughly approximating the number of vertices generated by a non-geodesic sphere of the same segment count.

With either approximation, increasing the `SCNSphere`

property produces more vertices and a more smoothly curved surface, which can improve rendering quality at a cost to rendering performance.

To position and orient a sphere in a scene, attach it to the `geometry`

property of an `SCNNode`

object.