Jump to content
  • Advertisement
Sign in to follow this  
vlzvl

problem with a custom .X parser

This topic is 3642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
yesss, the zero-position of matrix did the job!
It was really stupid to apply the matrix (previously) on original
normals & waiting to get correct skinned normals ;) i -never- thought that normals actually havent positions ;) ...now the performance really improved,
my very thanx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!