My current method is as follows:
- create an ID3DXMesh and load it with an OBJ file
- generate adjacency
- compute normals (right-hand <-> left hand messes up lighting somehow, this fixes it)
- validate mesh, and if failed, clean using D3DXCLEAN_SIMPLIFICATION, and setting the output mesh and adjacency to the same as input
- weld twice, using a zeroed epsilons structure
- set a different weight for every vertex (in a for loop execute vertexWeights = (float)i / (float)vertexCount;)
- create an ATTRIBUTEWEIGHTS structure, and zeromemory it
- generate the mesh using HRESULT generateProgressiveMeshResult = D3DXGeneratePMesh(mesh, adjacency, &attributeWeights, vertexWeights, 100, D3DXMESHSIMP_VERTEX, &progressiveMesh);
Is this normal? Or am I missing something which would allow me to get the requested 100 vertices (or close to it)?
I have also thought of upgrading the editor to allow editing of vertex weights, to see the result as you edit them, but that does not sound fun, and I'm pretty sure my artist would just lol.
B