problem with a custom .X parser
hello,
im creating an .X (directx format) custom decoder & i recently hit in a difficult to me issue: How to normalize vertices, after their skinning (moved somewhere depending on a parent -> child logic)
The 'MeshNormals' template in the .X files cant help here (i think) because they have the -static- normal for the static version of the model.
So, without second thought, i started to normalize my triangles by
group-smoothing them, which means neighbors has to be found first, then take their flat normal etc. etc. This appraoch really works but when you have a model of 5000+ tris & 30+ frames, this can be ridiculusly slow (about 30-40 secs in a medium cpu)
So, i ask if there is an easier way, say transforming somehow the 'static' normals to meet their skinned vertices? has anyone solved WITHOUT THE D3D EXTENSIONS ? I forgot to tell you, this custom decoder works without D3DX* funcs, and i want to leave it that way...
Thanx in advance.
I assume you're using some sort of matrix to position and rotate your vertex positions with respect to their parent transformations. Use the same matrix, leaving out the translation ( set _41, _42, _43 to 0 ), for the vertex normals (assuming you're using a column-major transformation matrix).
If the vertex normals are correct for the ragdoll pose (the -static- pose), they're good for the skinned mesh.
If the vertex normals are correct for the ragdoll pose (the -static- pose), they're good for the skinned mesh.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement