Creating A Torus

Torus

The created torus (doughnut shape) has its origin at the center of the torus. You can control its diameter and the thickness of its circular body.

MeshBuilder

Example :

const torus = BABYLON.MeshBuilder.CreateTorus("torus", options, scene);
optionvaluedefault value
option
diameter
value
(number) diameter of the torus
default value
1
option
thickness
value
(number) thickness of its tube
default value
0.5
option
tessellation
value
(number) number of segments along the circle
default value
16
option
updatable
value
(boolean) true if the mesh is updatable
default value
false
option
sideOrientation
value
(number) side orientation
default value
DEFAULTSIDE
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

Thick: Create a Thick Torus Thin: Create a Thin Torus

Mesh

Usage

const torus = BABYLON.Mesh.CreateTorus("torus", diameter, thickness, tessellation, scene);
const torus = BABYLON.Mesh.CreateTorus("torus", diameter, thickness, tessellation, scene, updatable, sideOrientation); //optional parameters after scene