Creating A Plane

Plane

The created plane is a flat surface parallel to the xy plane with its origin at the center of the plane.

MeshBuilder

Usage :

const plane = BABYLON.MeshBuilder.CreatePlane("plane", options, scene); //scene is optional and defaults to the current scene
optionvaluedefault value
option
size
value
(number) side size of the plane
default value
1
option
width
value
(number) size of the width
default value
size
option
height
value
(number) size of the height
default value
size
option
updatable
value
(boolean) true if the mesh is updatable
default value
false
option
sideOrientation
value
(number) side orientation
default value
DEFAULTSIDE
option
sourcePlane
value
(Plane) source plane (math) the mesh will be transformed to
default value
null
option
frontUVs
value
(Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE set
default value
Vector4(0,0, 1,1)
option
backUVs
value
(Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE set
default value
Vector4(0,0, 1,1)

Examples

Single sided: Create a Single Sided Plane
Double sided: Create a Double Sided Plane

Using this image
Two Tile Pattern
to texture the front and back
front and back Front and Back Texture

We can also create a plane from an abstract math plane

Create a Plane From Math Path

Mesh

Usage :

const plane = BABYLON.Mesh.CreatePlane("plane", size, scene);
const plane = BABYLON.Mesh.CreatePlane("plane", size, scene, updatable, sideOrientation); //optional parameters after scene

It is only possible to create a square with this method, for a rectangle you need to use scaling.