Microsoft DirectX 8.1 (Visual Basic)

D3DX8.ComputeNormals

Computes normals for each vertex in a mesh.

object.ComputeNormals( _ 
    Mesh As D3DXBaseMesh)

Parts

object
Object expression that resolves to a D3DX8 object.
Mesh
D3DXBaseMesh object representing the normalized mesh object.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Note  The input mesh must have the D3DFVF_NORMAL flag specified in its FVF.

A normal for a vertex is generated by averaging the normals of all faces that share that vertex.