Skip to main content
Version: Next

Sphere Geometry Constructor

A class for generating sphere geometries.

Description

The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to 'sphere slices') can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.

Inputs

  • radius (Number): sphere radius. Default is 1.
  • widthSegments (Number): number of horizontal segments. Minimum value is 3, and the default is 32.
  • heightSegments (Number): number of vertical segments. Minimum value is 2, and the default is 16.
  • phiStart (Number): specify horizontal starting angle. Default is 0.
  • phiLength (Number): specify horizontal sweep angle size. Default is Math.PI * 2.
  • thetaStart (Number): specify vertical starting angle. Default is 0.
  • thetaLength (Number): specify vertical sweep angle size. Default is Math.PI.

Outputs

  • Sphere (ThreeJSSphereGeometry): SphereGeometry