• Generates tangent information from the specified positions, normals, texture coordinates and triangle indices.

    Parameters

    • positions: number[]

      An array of 3-dimensional vertex positions.

    • normals: number[]

      An array of 3-dimensional vertex normals.

    • uvs: number[]

      An array of 2-dimensional vertex texture coordinates.

    • indices: number[]

      An array of triangle indices.

    Returns number[]

    An array of 3-dimensional vertex tangents.

    Example

    const tangents = pc.calculateTangents(positions, normals, uvs, indices);