Mirror Engine
V7
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / SphereGeometry

Class: SphereGeometry

A procedural sphere-shaped geometry.

The size and tesselation properties of the sphere can be controlled via constructor 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.

Extends

Extended by

Constructors

new SphereGeometry()

new SphereGeometry(opts?: {
  calculateTangents: boolean;
  latitudeBands: number;
  longitudeBands: number;
  radius: number;
 }): SphereGeometry

Create a new SphereGeometry instance.

Parameters

opts?

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

SphereGeometry

Overrides

Geometry.constructor

Properties

blendIndices

blendIndices: undefined | number[];

Blend indices.

Inherited from

Geometry.blendIndices


blendWeights

blendWeights: undefined | number[];

Blend weights.

Inherited from

Geometry.blendWeights


colors

colors: undefined | number[];

Colors.

Inherited from

Geometry.colors

Methods

calculateNormals()

calculateNormals(): void

Generates normal information from the positions and triangle indices.

Returns

void

Inherited from

Geometry.calculateNormals


calculateTangents()

calculateTangents(): void

Generates tangent information from the positions, normals, texture coordinates and triangle indices.

Returns

void

Inherited from

Geometry.calculateTangents

Mirror Engine Logo