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

    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 = pc.calculateNormals(positions, indices);
    const mesh = pc.createMesh(graphicsDevice, positions, {
    normals: normals,
    uvs: uvs,
    indices: indices
    });