Engine API Reference - v2.6.1
    Preparing search index...

    Function calculateTangents

    • 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.

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