Mirror Engine
V5
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / calculateNormals

Function: calculateNormals()

function calculateNormals(positions: number[], indices: number[]): number[]

Generates normal information from the specified positions and triangle indices.

Parameters

positions

number[]

An array of 3-dimensional vertex positions.

indices

number[]

An array of triangle indices.

Returns

number[]

An array of 3-dimensional vertex normals.

Example

const normals = calculateNormals(positions, indices)
Mirror Engine Logo