Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IcoSphereBuilder

Class containing static functions to help procedurally build meshes

Hierarchy

  • IcoSphereBuilder

Index

Methods

Methods

Static CreateIcoSphereSearch playground for CreateIcoSphere

  • CreateIcoSphere(name: string, options: { backUVs?: Vector4; flat?: boolean; frontUVs?: Vector4; radius?: number; radiusX?: number; radiusY?: number; radiusZ?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }, scene?: Nullable<Scene>): Mesh
  • Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided

    • The parameter radius sets the radius size (float) of the icosphere (default 1)
    • You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters radiusX, radiusY and radiusZ (all by default have the same value of radius)
    • The parameter subdivisions sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
    • The parameter flat (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
    • 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 and backUVs (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
    see

    https://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere

    Parameters

    • name: string

      defines the name of the mesh

    • options: { backUVs?: Vector4; flat?: boolean; frontUVs?: Vector4; radius?: number; radiusX?: number; radiusY?: number; radiusZ?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }

      defines the options used to create the mesh

      • Optional backUVs?: Vector4
      • Optional flat?: boolean
      • Optional frontUVs?: Vector4
      • Optional radius?: number
      • Optional radiusX?: number
      • Optional radiusY?: number
      • Optional radiusZ?: number
      • Optional sideOrientation?: number
      • Optional subdivisions?: number
      • Optional updatable?: boolean
    • Optional scene: Nullable<Scene>

      defines the hosting scene

    Returns Mesh

    the icosahedron mesh

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method