BabylonJS - Cone



This is one of the shapes used with the MeshBuilder.

Syntax

Following is the syntax to create a Cone −

var cone = BABYLON.MeshBuilder.CreateCylinder("cone", {height,diameterTop: 0, diameterBottom, diameter, tessellation: 4, subdivisions, faceColors, faceUV, arc, updatable}, scene);

CreateCylinder is used to create both cylinder and cone and the same is controlled by the diameterTop property. If set to 0, it is a cone; and if it is greater than 0, it is a cylinder.

Parameters

Consider the following parameters to create a cone −

  • Height − Height given to the cylinder.

  • DiameterTop − Diameter given to the top cap. If 0, it will be cone. It will overwrite the diameter property.

  • DiameterBottom − Diameter for the bottom. It has to be greater than 0. It overwrites the diameter property.

  • Diameter − Diameter for the top and bottom.

  • Tessellation − Number of radial sides.

  • Subdivisions − Number of rings.

  • FaceColors − Array of 3 Color4, 0 : bottom cap, 1 : cylinder tube, 2 : top cap

  • FaceUV − Array of 3 Vector4, 0 : bottom cap, 1 : cylinder tube, 2 : top cap

  • Arc − Ratio of circumference between 0 and 1

  • Updatable − By default, this is set to false. If it needs to be updated during morphing, you can set it to true.

babylonjs_mesh.htm
Advertisements