Mesh.ComputeTangent(Int32,Int32,Int32,Int32,Int32[]) Method (Microsoft.DirectX.Direct3D)
Computes the tangent vectors for the texture coordinates given in a texture stage.
Definition
Visual Basic Public Sub ComputeTangent( _
ByVal texStage As Integer, _
ByVal tangentIndex As Integer, _
ByVal binormIndex As Integer, _
ByVal wrap As Integer, _
ByVal adjacency() As Integer _
)C# public void ComputeTangent(
int texStage,
int tangentIndex,
int binormIndex,
int wrap,
int[] adjacency
);C++ public:
void ComputeTangent(
int texStage,
int tangentIndex,
int binormIndex,
int wrap,
array<int>^ adjacency
);JScript public function ComputeTangent(
texStage : int,
tangentIndex : int,
binormIndex : int,
wrap : int,
adjacency : int[]
);
Parameters
texStage System.Int32
Index that represents the TextureStateManager in TextureStateManagerCollection.tangentIndex System.Int32
Index that provides the usage index for the tangent data. The vertex declaration implies the usage; this index modifies it.binormIndex System.Int32
Index that provides the usage index for the binormal data. The vertex declaration implies the usage; this index modifies it.wrap System.Int32
Value that is set to 0 to specify no wrapping, or to 1 to specify wrapping in the u and v directions.adjacency System.Int32[]
Array of three Int32 values per face that specify the three neighbors for each face in the mesh. The size of this array must be at least 3 * BaseMesh.NumberFaces.
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
The method call is invalid. For example, a method's parameter might contain an invalid value.
Microsoft Direct3D could not allocate sufficient memory to complete the call.