Create a solid 3D cylinder. The base of the cylinder is parallel to the XY plane of the coordinate system and has its center at coordinates 0,0,0. The height is perpendicular to the base and parallel to the Z-axis.

syntaxSyntax:
new DlxCylinder(radius, height, style, bTop=true, bBottom=true, slices=0)

Parameters

Parameter Description
radius The radius of the cylinder.
height The height corresponds to the Z-axis.
style A Dlx3DStyle object or the index of the style. There are 10 styles available with indexes from 0 to 9.
bTop If true, the cylinder has a closed upper face.
bBottom If true, the cylinder has a closed lower face.
slices Indicates the number of slices. Specify 0 for the default value.

Example

  Copy codeCopy code
function OnBuild3DModel()
{
  var ctx = FWiz.Get3DModelCtx();
  var style = FWiz.Get3DStyle(0);
  style.SetStyle("gold");
  var obj = new DlxCylinder(10, 30, style);
  ctx.Add(obj);
}

See also