How to remove BOWTIES from ID3DXMesh?

Started by
4 comments, last by domin 18 years, 3 months ago
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.
Advertisement
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Still no luck. Last returned parameter is NULL so I suppose that there is no errors.
I checked how many vertices is before the call and how many after. The number is identical so it looks like this function fail...

This topic is closed to new replies.

Advertisement