navcat docs
    Preparing search index...

    Function randomPointInConvexPoly

    • Generates a random point inside a convex polygon using barycentric coordinates.

      Parameters

      • out: Vec3

        Output point [x,y,z]

      • nv: number
      • verts: number[]

        Polygon vertices as flat array [x,y,z,x,y,z,...]

      • areas: number[]

        Temporary array for triangle areas (will be modified)

      • s: number

        Random value [0,1] for triangle selection

      • t: number

        Random value [0,1] for point within triangle

      Returns Vec3