Engine API Reference - v2.22.0-beta.8
    Preparing search index...

    Function calculateNormals

    • Generates normal information from the specified positions and triangle indices.

      Parameters

      • positions: ArrayLike<number>

        An array of 3-dimensional vertex positions.

      • indices: ArrayLike<number>

        An array of triangle indices.

      Returns number[]

      An array of 3-dimensional vertex normals.

      const normals = calculateNormals(positions, indices);