Creating A Ground

Ground

A ground is a flat horizontal plane parallel to the xz plane which can be subdivided into rectangular regions. The origin of the ground is at the center of the plane. The optional properties for determining the size of the ground are width (x) and height (z) (and yes we all agree that depth would be more descriptive than height!)

MeshBuilder

Usage :

const ground = BABYLON.MeshBuilder.CreateGround("ground", options, scene); //scene is optional and defaults to the current scene
optionvaluedefault value
option
width
value
(number) size of the width
default value
1
option
height
value
(number) size of the height
default value
1
option
updatable
value
(boolean) true if the mesh is updatable
default value
false
option
subdivisions
value
(number) number of square subdivisions
default value
1

Example

Ground: Create a Ground

Mesh

Usage

const ground = BABYLON.Mesh.CreateGround("ground", width, height, subdivisions, scene);
const ground = BABYLON.Mesh.CreateGround("ground", width, height, subdivisions, scene, updatable); //one optional parameter after scene