Assimp Distorted Skinned Mesh

Started by
11 comments, last by 215648 9 years, 10 months ago

OH YES! I got it working. It was because I was scaling model at the time of loading (multiplying vertex position with scaling factors.) instead of using matrix for scaling.

Thank you all for your help.

Advertisement


I already said it works fine in assimp viewer


Editing a previous post and then claiming you already answered the question is considered poor style.

newtechnology
Posted Yesterday, 03:09 AM
No. I think the problem is the method by which I extract Bone Indices and Bone weights. Look at SkinnedMesh.cpp for the loading code.

newtechnology
Posted Yesterday, 03:54 AM
No. I think the problem is the method by which I extract Bone Indices and Bone weights. Look at SkinnedMesh.cpp for the loading code. And yes, it loads fine in assimp viewer.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.


I already said it works fine in assimp viewer


Editing a previous post and then claiming you already answered the question is considered poor style.

newtechnology
Posted Yesterday, 03:09 AM
No. I think the problem is the method by which I extract Bone Indices and Bone weights. Look at SkinnedMesh.cpp for the loading code.

newtechnology
Posted Yesterday, 03:54 AM
No. I think the problem is the method by which I extract Bone Indices and Bone weights. Look at SkinnedMesh.cpp for the loading code. And yes, it loads fine in assimp viewer.

I think you need glasses.

newtechnology

Posted Yesterday, 07:08 AM -> DO NOT MISS THIS

No. I think the problem is the method by which I extract Bone Indices and Bone weights. Look at SkinnedMesh.cpp for the loading code. And yes, it loads fine in assimp viewer.

Buckeye

Posted Yesterday, 06:09 PM -> DO NOT MISS THIS

I don't think you understood (or answered) unbird's question. Have you tried opening the file with the assimp viewer? I.e., not your own code, but the viewer than comes with the assimp download. Confirming that the file data is good and can be displayed correctly should be your first priority.

You don't mention what type of file you're loading. If it's in text format in its original form (or you can transform it to text), I would suggest you follow your code, step-by-step, confirming that the data you read in and store is reasonable by comparing it with the file itself.

Regarding bone weights, you can add checks for the number of bone indices and the sum of the weights for each vertex as you load it and popup a messagebox or output debug info if something isn't appropriate. E.g., report if the number of bone indices is greater than your shader expects or will handle. Does every bone-weights-sum for every vertex = 1? etc.

In addition, after the bone indices/weights are loaded for a vertex, you can sort them by weight, throw away those in excess of the number you want, and renormalize the remaining weights so they always sum to one.

You can ensure a better display: if, for example, your shader will handle 4 indices/weights, then, in the shader code, use only the first 3 weights and set the 4th weight to 1.0 - weight0 - weight1 - weight2.

This topic is closed to new replies.

Advertisement