webgpu-utils

    Function createXYQuadVertices

    • Creates XY quad vertices

      The default with no parameters will return a 2x2 quad with values from -1 to +1. If you want a unit quad with that goes from 0 to 1 you'd call it with

      createXYQuadVertices(1, 0.5, 0.5);
      

      If you want a unit quad centered above 0,0 you'd call it with

      primitives.createXYQuadVertices(1, 0, 0.5);
      

      Parameters

      • params: { size?: number; xOffset?: number; yOffset?: number } = {}
        • Optionalsize?: number

          the size across the quad. Defaults to 2 which means vertices will go from -1 to +1

        • OptionalxOffset?: number

          the amount to offset the quad in X. Default = 0

        • OptionalyOffset?: number

          the amount to offset the quad in Y. Default = 0

      Returns Arrays

      the created XY Quad vertices

    MMNEPVFCICPMFPCPTTAAATR