How to remove BOWTIES from ID3DXMesh?
Hi all, I have problem with computing binormals and tangents for my mesh using D3DXComputeTangentFrame function.
It gives me this output:
A bowtie was found. Bowties can be fixed by call D3DXCleanMesh.
A bowtie is the usage of a single vertex by two separate fans of triangles.
The fix is to duplicate the vertex so that each fan has its own vertex.
D3DXComputeTangentFrame: Mesh is not valid.
D3DXComputeTangentFrame: Unable to create consistent tangent frames in this mesh without splitting vertices.
I called D3DXCleanMesh, but this do nothing - problem still exists...
Please help.
What parameters did you use for D3DXCleanMesh()? You'd have to pass in D3DXCLEAN_BOWTIES as the first parameter to solve your problem. I presume the call succeeds? No errors whilst trying to clean (checked the debug output as well?).
Another simple check is to query how many vertices you have before the call, and how many afterwards. Cleaning for bow ties tends to require duplication/splitting of vertices - thus the cleaned mesh should have more than when it started.
hth
Jack
Another simple check is to query how many vertices you have before the call, and how many afterwards. Cleaning for bow ties tends to require duplication/splitting of vertices - thus the cleaned mesh should have more than when it started.
hth
Jack
Thanks for answer. Yes, I use D3DXCLEAN_BOWTIES (already tried all combinations), result is D3D_OK... No idea what is wrong...
Have you examined the results of the last parameter? (LPD3DXBUFFER * ppErrorsAndWarnings)
The documentation doesn't indicate any situations where it'll fail to clean a mesh, but I suppose it is possible that it's getting stuck somewhere and thus doesn't remove all the bowties. Checking the aforementioned warnings/errors may well give you some clues...
hth
Jack
The documentation doesn't indicate any situations where it'll fail to clean a mesh, but I suppose it is possible that it's getting stuck somewhere and thus doesn't remove all the bowties. Checking the aforementioned warnings/errors may well give you some clues...
hth
Jack
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement