Class BoxBuilder
Hierarchy
- BoxBuilder
Index
Methods
Methods
Static Create BoxSearch playground for CreateBox
-
Creates a box mesh
- The parameter
size
sets the size (float) of each box side (default 1) - You can set some different box dimensions by using the parameters
width
,height
anddepth
(all by default have the same value ofsize
) - You can set different colors and different images to each box side by using the parameters
faceColors
(an array of 6 Color3 elements) andfaceUV
(an array of 6 Vector4 elements) - Please read this tutorial : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
- 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: { backUVs?: Vector4; bottomBaseAt?: number; depth?: number; faceColors?: Color4[]; faceUV?: Vector4[]; frontUVs?: Vector4; height?: number; sideOrientation?: number; size?: number; topBaseAt?: number; updatable?: boolean; width?: number; wrap?: boolean }
defines the options used to create the mesh
-
Optional backUVs?: Vector4
-
Optional bottom
Base At?: number -
Optional depth?: number
-
Optional face
Colors?: Color4[] -
Optional faceUV?: Vector4[]
-
Optional frontUVs?: Vector4
-
Optional height?: number
-
Optional side
Orientation?: number -
Optional size?: number
-
Optional top
Base At?: number -
Optional updatable?: boolean
-
Optional width?: number
-
Optional wrap?: boolean
-
-
Optional scene: Nullable<Scene>
defines the hosting scene
Returns Mesh
the box mesh
- The parameter
Class containing static functions to help procedurally build meshes