Class: Sphere

Sphere~Sphere(options, classSettingsopt)

new Sphere(options, classSettingsopt)

Sphere graphical object.
Parameters:
Name Type Attributes Description
options Options See Options.
classSettings object <optional>
Sphere class settings.
Properties
Name Type Attributes Default Description
bodyId number <optional>
0 Identifier of the array of the faces ids in the classSettings.settings.object.geometry.indices.bodies array.
faceGroups number <optional>
0 Face groups level. You can define sphere's faces count (fc) as fc = 2 ^ ((faceGroups + 1) * 2.
Examples:
faceGroupsfaces count
04
116
264
3256
41024
54096
settings object <optional>
The following settings are available
Properties
Name Type Attributes Description
object object <optional>
Sphere object.
Properties
Name Type Attributes Default Description
name String <optional>
'Sphere' name of sphere.
color String <optional>
'lime' color of edges.
geometry object <optional>
Sphere geometry.
Properties
Name Type Attributes Description
indices object <optional>
Array of indices of vertices, edges, faces and bodies of sphere.
Properties
Name Type Attributes Default Description
count number <optional>
4 facess count. Default sphere is pyramid with 4 faces.
edges Array <optional>
[{}, {}, {}, {vertices: [0,3]}, {vertices: [1,3]}, {vertices: [2,3]}] Edges array. Default edges count is classSettings.settings.object.geometry.indices.count.
Properties
Name Type Attributes Description
edge object <optional>
Edges array item is edge.
Properties
Name Type Attributes Default Description
vertices Array <optional>
Array of edge vertices indices. Every edge have two vertices.
distance float <optional>
1.632993154528117 Edge length. Distance between edge vertices.
faces Array <optional>
[[0, 1, 2], [0, 3, 4], [1, 4, 5], [2, 3, 5]] Faces array. Every item of the faces array is array of edges indices for current face.
bodies Array <optional>
[[0, 1, 2, 3]] Bodies array. Every item of the bodies array is array of facess indices for current body.
debug boolean <optional>
false Debug mode. Diagnoses your code and display detected errors in console
Source:

Methods

project(scene, paramsopt)

Projects a sphere to the canvas
Parameters:
Name Type Attributes Description
scene THREE.Scene THREE.Scene
params object <optional>
The following parameters are available
Properties
Name Type Attributes Default Description
center object <optional>
center of the sphere
Properties
Name Type Attributes Default Description
x float <optional>
0.0 X axis of the center
y float <optional>
0.0 Y axis of the center
z float <optional>
0.0 z axis of the center
radius float <optional>
1.0 radius of the sphere
Source: