Click or drag to resize
AB4D logo

MeshUtilsCalculateNormals(PositionNormalTexture, Int32, Int32, Int32, Boolean) Method

CalculateNormals method calculates normals for the specified vertexBuffer (PositionNormalTexture array) and triangle indices array. Normal values are written to the vertexBuffer.

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

Parameters

vertexBuffer  PositionNormalTexture
array of PositionNormalTexture that represents a vertex buffer
indices  Int32
triangle indices
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