How To

Mirror Engine API / calculateTangents
Function: calculateTangents()
function calculateTangents(
positions: number[],
normals: number[],
uvs: number[],
indices: number[]
): number[]
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 = calculateTangents(positions, normals, uvs, indices)