BufferGeometry

SphereBufferGeometry

This is the BufferGeometry port of SphereGeometry.

Example

var geometry = new v3d.SphereBufferGeometry(5, 32, 32); var material = new v3d.MeshBasicMaterial({color: 0xffff00}); var sphere = new v3d.Mesh(geometry, material); scene.add(sphere);

Constructor

SphereBufferGeometry(radius : Float, widthSegments : Integer, heightSegments : Integer, phiStart : Float, phiLength : Float, thetaStart : Float, thetaLength : Float)

radius — sphere radius. Default is 1.
widthSegments — number of horizontal segments. Minimum value is 3, and the default is 8.
heightSegments — number of vertical segments. Minimum value is 2, and the default is 6.
phiStart — specify horizontal starting angle. Default is 0.
phiLength — specify horizontal sweep angle size. Default is Math.PI * 2.
thetaStart — specify vertical starting angle. Default is 0.
thetaLength — specify vertical sweep angle size. Default is Math.PI.

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.

Properties

.parameters

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

Source

For more info on how to obtain the source code of this module see this page.