Class SphereBuilder
Hierarchy
- SphereBuilder
Index
Methods
Methods
Static Create SphereSearch playground for CreateSphere
-
Creates a sphere mesh
- The parameter
diameter
sets the diameter size (float) of the sphere (default 1) - You can set some different sphere dimensions, for instance to build an ellipsoid, by using the parameters
diameterX
,diameterY
anddiameterZ
(all by default have the same value ofdiameter
) - The parameter
segments
sets the sphere number of horizontal stripes (positive integer, default 32) - You can create an unclosed sphere with the parameter
arc
(positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio - You can create an unclosed sphere on its height with the parameter
slice
(positive float, default1), valued between 0 and 1, what is the height ratio (longitude) - You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
- If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters
frontUVs
andbackUVs
(Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation - The mesh can be set to updatable with the boolean parameter
updatable
(default false) if its internal geometry is supposed to change once created
Parameters
-
name: string
defines the name of the mesh
-
options: { arc?: number; backUVs?: Vector4; diameter?: number; diameterX?: number; diameterY?: number; diameterZ?: number; frontUVs?: Vector4; segments?: number; sideOrientation?: number; slice?: number; updatable?: boolean }
defines the options used to create the mesh
-
Optional arc?: number
-
Optional backUVs?: Vector4
-
Optional diameter?: number
-
Optional diameterX?: number
-
Optional diameterY?: number
-
Optional diameterZ?: number
-
Optional frontUVs?: Vector4
-
Optional segments?: number
-
Optional side
Orientation?: number -
Optional slice?: number
-
Optional updatable?: boolean
-
-
Optional scene: Nullable<Scene>
defines the hosting scene
Returns Mesh
the sphere mesh
- The parameter
Class containing static functions to help procedurally build meshes