MeshHelper.CalculateTangentFrames Method
Note
This method is available only when developing for Windows.
Compute tangent frames for the given mesh.
Syntax
'Declaration
Public Shared Sub CalculateTangentFrames ( _
mesh As MeshContent, _
textureCoordinateChannelName As String, _
tangentChannelName As String, _
binormalChannelName As String _
)
public static void CalculateTangentFrames (
MeshContent mesh,
string textureCoordinateChannelName,
string tangentChannelName,
string binormalChannelName
)
public:
static void CalculateTangentFrames(
MeshContent mesh,
String textureCoordinateChannelName,
String tangentChannelName,
String binormalChannelName
)
Parameters
- mesh
Type: MeshContent
The target mesh used to create the tangent frame. All geometries in this mesh must have normal vertex channels stored in Normal, and must contain Vector3 data. - textureCoordinateChannelName
Type: String
The texture coordinate channel used for computing the tangent frame. This channel most contain Vector2 data. - tangentChannelName
Type: String
Target channel name used to store calculated tangents. A tangent channel is not generated if null or an empty string is specified. - binormalChannelName
Type: String
Target channel name used to store calculated binormals. A tangent channel is not generated if null or an empty string is specified.
Remarks
This method computes and adds tangent and binormal vertex channels to the given mesh.
An InvalidContentException is thrown if:
- The mesh does not contain a normal channel (stored in Normal).
- The data specified in the normal channel is not a Vector3 type.
- The vertex channel of the mesh does not have the name specified by textureCoordinateChannelName.
- The data specified in the texture coordinate channel is not a Vector2 type.
- The channel specified by tangentChannelName already exists.
- The channel specified by binormalChannelName already exists.
Requirements
Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)
See Also
Reference
MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace
Platforms
Windows 7, Windows Vista, Windows XP