Richy
2007-11-07 01:57:10 UTC
Hi,
I'm trying to generate the binormals/tangents for a .x mesh using the
ComputeTangentFrame method. I have cloned my mesh to use my own vertex
format that includes the binormal and tangent (are there any rules
specifying where in the declaration they should be?) but all I get is
an "error in the application". I tried debugging using the debug mode
and debugview.exe but it does not return any message in the console.
I have also tried creating a box (using Mesh.Box) and then cloning
that to use my vertex format, and then using ComputeTangentFrame on
that but still the same issue.
Is the method buggy or is it something to do with my vertex
declaration (reproduced below)?
Cheers,
Richy
Friend _worldElements() As VertexElement = { _
New VertexElement(0, 0, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Position, 0), _
New VertexElement(0, 12, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Normal, 0), _
New VertexElement(0, 24, DeclarationType.Float2,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), _
New VertexElement(0, 32, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 1), _
New VertexElement(0, 48, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 2), _
New VertexElement(0, 64, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 3), _
New VertexElement(0, 80, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 4), _
New VertexElement(0, 96, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Tangent, 0), _
New VertexElement(0, 108, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.BiNormal, 0), _
VertexElement.VertexDeclarationEnd}
I'm trying to generate the binormals/tangents for a .x mesh using the
ComputeTangentFrame method. I have cloned my mesh to use my own vertex
format that includes the binormal and tangent (are there any rules
specifying where in the declaration they should be?) but all I get is
an "error in the application". I tried debugging using the debug mode
and debugview.exe but it does not return any message in the console.
I have also tried creating a box (using Mesh.Box) and then cloning
that to use my vertex format, and then using ComputeTangentFrame on
that but still the same issue.
Is the method buggy or is it something to do with my vertex
declaration (reproduced below)?
Cheers,
Richy
Friend _worldElements() As VertexElement = { _
New VertexElement(0, 0, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Position, 0), _
New VertexElement(0, 12, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Normal, 0), _
New VertexElement(0, 24, DeclarationType.Float2,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), _
New VertexElement(0, 32, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 1), _
New VertexElement(0, 48, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 2), _
New VertexElement(0, 64, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 3), _
New VertexElement(0, 80, DeclarationType.Float4,
DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 4), _
New VertexElement(0, 96, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Tangent, 0), _
New VertexElement(0, 108, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.BiNormal, 0), _
VertexElement.VertexDeclarationEnd}