• Creates a procedural sphere-shaped mesh.

    The size and tesselation properties of the sphere can be controlled via function parameters. By default, the function will create a sphere centered on the object space origin with a radius of 0.5 and 16 segments in both longitude and latitude.

    Note that the sphere is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the sphere's mesh.

    Parameters

    • device: GraphicsDevice

      The graphics device used to manage the mesh.

    • Optional opts: {
          calculateTangents: boolean;
          latitudeBands: number;
          longitudeBands: number;
          radius: number;
      } = {}

      An object that specifies optional inputs for the function as follows:

      • calculateTangents: boolean

        Generate tangent information (defaults to false).

      • latitudeBands: number

        The number of divisions along the latitudinal axis of the sphere (defaults to 16).

      • longitudeBands: number

        The number of divisions along the longitudinal axis of the sphere (defaults to 16).

      • radius: number

        The radius of the sphere (defaults to 0.5).

    Returns Mesh

    A new sphere-shaped mesh.