Click or drag to resize
AB4D logo

MeshUtilsCalculateNormals(Vector3, Int32, Vector3, Int32, Int32, Boolean) Method

CalculateNormals method calculates normals for the specified positions and and triangle indices arrays. Normal values are written to the specified normals array.

Namespace: Ab3d.DirectX.Utilities
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.1.9105.2048
Syntax
C#
public static void CalculateNormals(
	Vector3[] positions,
	int[] indices,
	Vector3[] normals,
	int startTriangleIndex,
	int indicesCount,
	bool normalize = true
)

Parameters

positions  Vector3
array of Vector3 that represents positions
indices  Int32
array of integers that represents triangle indices
normals  Vector3
array of Vector3 that represents normals - the values in this array will be filled with normal values. This array needs to be the same length or longer then the positions array
startTriangleIndex  Int32
index of the first triangle index to process (note that this is not triangle index but index in the indices array so the startTriangleIndex for the second triangle is 3)
indicesCount  Int32
number of triangle indices to process (to get indicesCount from the number of triangles multiply the number of triangle by 3)
normalize  Boolean  (Optional)
when true (by default), then the normals are normalized
See Also