The PrimitiveMesh class is used to create simple meshes.

PrimitiveMesh 类用于创建简单的网格。

构造函数

方法

  • 参数

    • long: number = 1

      The length of the box. Default is 1.

    • height: number = 1

      The height of the box. Default is 1.

    • width: number = 1

      The width of the box. Default is 1.

    返回 Mesh

    The created Mesh instance.

    Creates a box mesh.

    创建一个立方体网格。

  • 参数

    • radius: number = 0.5

      The radius of the capsule. Default is 0.5.

    • height: number = 2

      The height of the capsule. Default is 2.

    • stacks: number = 16

      The number of stacks, typically half the number of vertical slices. Default is 16.

    • slices: number = 32

      The number of vertical slices. Default is 32.

    返回 Mesh

    Creates a capsule mesh.

    创建一个胶囊体网格。

  • 参数

    • radius: number = 0.5

      The radius of the base of the cone. Default is 0.5.

    • height: number = 1

      The height of the cone. Default is 1.

    • slices: number = 32

      The number of segments around the base of the cone. Default is 32.

    返回 Mesh

    The created Mesh instance.

    Creates a cone mesh.

    创建一个圆锥体网格。

  • 参数

    • radius: number = 0.5

      The radius of the cylinder. Default is 0.5.

    • height: number = 2

      The height of the cylinder. Default is 2.

    • slices: number = 32

      The number of vertical segments of the cylinder. Default is 32.

    返回 Mesh

    The created Mesh instance.

    Creates a cylinder mesh.

    创建一个圆柱体网格。

  • 参数

    • long: number = 10

      The length of the plane. Default is 10.

    • width: number = 10

      The width of the plane. Default is 10.

    • stacks: number = 10

      The number of longitudinal subdivisions. Default is 10.

    • slices: number = 10

      The number of latitudinal subdivisions. Default is 10.

    返回 Mesh

    The created Mesh instance.

    Creates a plane mesh.

    创建一个平面网格。

  • 参数

    • long: number = 1

      The length of the quad. Default is 1.

    • width: number = 1

      The width of the quad. Default is 1.

    返回 Mesh

    The created Mesh instance.

    Creates a quad mesh.

    创建一个四边形网格。

  • 参数

    • radius: number = 0.5

      The radius of the sphere. Default is 0.5.

    • stacks: number = 32

      The number of stacks, typically used for the vertical slices. Default is 32.

    • slices: number = 32

      The number of slices, typically used for the horizontal circles. Default is 32.

    返回 Mesh

    The created Mesh instance.

    Creates a sphere mesh.

    创建一个球体网格。