![]() |
![]() |
![]() |
Mesh.ComputeTangent Method |
Language: |
Computes the tangent vectors for the texture coordinates given in a texture stage.
Visual Basic .NET Public Sub ComputeTangent( _
ByVal texStage As Integer, _
ByVal tangentIndex As Integer, _
ByVal binormIndex As Integer, _
ByVal wrap As Integer, _
ByVal adjacency As GraphicsStream _
)C# public void ComputeTangent(
int texStage,
int tangentIndex,
int binormIndex,
int wrap,
GraphicsStream adjacency
);Managed C++ public: void ComputeTangent(
int texStage,
int tangentIndex,
int binormIndex,
int wrap,
GraphicsStream *adjacency
);JScript .NET public function ComputeTangent(
texStage : int,
tangentIndex : int,
binormIndex : int,
wrap : int,
adjacency : GraphicsStream
);
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 Microsoft.DirectX.GraphicsStream. A GraphicsStream object filled with an array of three Int32 values per face to be filled with adjacent face indices.
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. OutOfMemoryException Microsoft® Direct3D® could not allocate sufficient memory to complete the call.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center