A builder for the GLTF Primitive object

Hierarchy

  • default<
        {
            attributes: {
                NORMAL?: Accessor;
                POSITION?: Accessor;
                TANGENT?: Accessor;
                [texcoord: `TEXCOORD_${number}`]: Accessor;
                [texcoord: `COLOR_${number}`]: Accessor;
                [texcoord: `JOINTS_${number}`]: Accessor;
                [texcoord: `WEIGHTS_${number}`]: Accessor;
            };
            indices: Accessor;
            material: Material;
            mode: RenderingMode;
        },
    >
    • Primitive

Properties

colour: (color: Accessor, index?: number) => Primitive

Type declaration

    • (color: Accessor, index?: number): Primitive
    • Sets data for the COLOR property on the primitive

      Parameters

      • color: Accessor

        Accessor containing Vec3 or Vec4 data

      • Optionalindex: number = 0

        The set index for this property, which gets applied in the form COLOR_

      Returns Primitive

      this

Accessors

  • get Modes(): {
        LINE_LOOP: 2;
        LINE_STRIP: 3;
        LINES: 1;
        POINTS: 0;
        TRIANGLE_FAN: 6;
        TRIANGLE_STRIP: 5;
        TRIANGLES: 4;
    }
  • Returns {
        LINE_LOOP: 2;
        LINE_STRIP: 3;
        LINES: 1;
        POINTS: 0;
        TRIANGLE_FAN: 6;
        TRIANGLE_STRIP: 5;
        TRIANGLES: 4;
    }

Methods

  • Sets data for the COLOR property on the primitive

    Parameters

    • color: Accessor

      Accessor containing Vec3 or Vec4 data

    • Optionalindex: number = 0

      The set index for this property, which gets applied in the form COLOR_

    Returns Primitive

    this

  • Sets data for the JOINTS property on the primitive

    Parameters

    • joints: Accessor

      Accessor containing Vec4 data

    • Optionalindex: number = 0

      The set index for this property, which gets applied in the form JOINTS_

    Returns Primitive

    this

  • Sets the mode for this primitive

    Parameters

    • mode: 0 | 1 | 2 | 3 | 4 | 5 | 6

    Returns Primitive

    this

  • Sets data for the TEXCOORD property on the primitive

    Parameters

    • texcoord: Accessor

      Accessor containing Vec2 data

    • Optionalindex: number = 0

      The set index for this property, which gets applied in the form TEXCOORD_

    Returns Primitive

    this

  • Sets data for the WEIGHTS property on the primitive

    Parameters

    • weights: Accessor

      Accessor containing Vec4 data

    • Optionalindex: number = 0

      The set index for this property, which gets applied in the form WEIGHTS_

    Returns Primitive

    this