Share via


Mesh.ComputeTangent Method ()

Computes the tangent vectors for the texture coordinates given in a texture stage.

Overload List

public void ComputeTangent(int, int, int, int);
public void ComputeTangent(int, int, int, int, GraphicsStream);
public void ComputeTangent(int, int, int, int, int[]);

Remarks

If the mesh vertex declaration specifies tangent or binormal fields, ComputeTangent updates any user-supplied tangent or binormal data. Alternatively, set tangentIndex to D3DX.Default to prevent updates to the user-supplied tangent data, or binormIndex to D3DX.Default to prevent updates to the user-supplied binormal data.

The ComputeTangent method depends on the mesh vertex declaration containing either the tangent field (tangentIndex), the binormal field (binormIndex), or both. If both are set to D3DX.Default, the method fails.

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.