Function createDiscVertices

  • Creates disc vertices. The disc will be in the xz plane, centered at the origin. When creating, at least 3 divisions, or pie pieces, need to be specified, otherwise the triangles making up the disc will be degenerate. You can also specify the number of radial pieces stacks. A value of 1 for stacks will give you a simple disc of pie pieces. If you want to create an annulus you can set innerRadius to a value > 0. Finally, stackPower allows you to have the widths increase or decrease as you move away from the center. This is particularly useful when using the disc as a ground plane with a fixed camera such that you don't need the resolution of small triangles near the perimeter. For example, a value of 2 will produce stacks whose outside radius increases with the square of the stack index. A value of 1 will give uniform stacks.

    Parameters

    • params: {
          divisions: undefined | number;
          innerRadius: undefined | number;
          radius: undefined | number;
          stackPower: undefined | number;
          stacks: undefined | number;
      } = {}
      • divisions: undefined | number

        Number of triangles in the ground plane (at least 3). Default = 24

      • innerRadius: undefined | number

        Default = 0

      • radius: undefined | number

        Radius of the ground plane. Default = 1

      • stackPower: undefined | number

        Power to raise stack size to for decreasing width. Default = 1

      • stacks: undefined | number

        Number of radial divisions. Default = 1

    Returns Arrays

    The created vertices.

Generated using TypeDoc