• Computes normal vectors for each vertex of a triangular mesh.

    The normal vector for each triangle with vertices (v0, v1, v2) is computed as the (normalized) cross product of (v1 - v0, v2 - v1). The normal vector for each vertex is obtained by averaging the normal vector of each of the triangles that contains it.

    Parameters

    • positions: Uint8Array | Uint16Array | Uint32Array | Float32Array

      The vertex positions in [x0, y0, z0, x1, y1, z1, ...] format.

    • indices: Uint8Array | Uint16Array | Uint32Array

      The indices of the triangle vertices. Each triplet of consecutive values specifies a triangle.

    Returns Float32Array

Generated using TypeDoc