After months giving up, I decide to fight again with the boneWeight and animation in Noesis.
The files come from jx2 - Kingsoft.
Mesh and bone are loaded correctly (or as I think so) but bone weight isn't.
There are 3 issues:
- I do not know how to use functions for bone weight in Noesis in my case.
- Why is there a 4x4 Mat for parent bone under each 4x4 Mat for each bone, or maybe I missunderstand about its role. See below for reference.
- How to test for the weight and bone when I have no animation file, is it anyway to create a simple animation for testing purpose?
Here is the file structure:
The ksword3d models look static - very simple, vertices 3 floats, normals 3 floats, UV 2 floats + 1 long, triangle strips?
I add structure of bone as below:
Code: Select all
bone offset 4 bytes - byte 188th from the beginning
After jumping to bone offset
number of bones 4 bytes
char bone-name 30 bytes
char parent-bone-name 30 bytes
int number of child bones 4 bytes
char child-bone-name[] 30 bytes
float transform-matrix[4][4] 64 bytes //need to be inversed
float parent bone transform-matrix[4][4] 64 bytes //need to be inversed
int number of vertex connected to this bone 4 bytes
int vertex id[] 4 bytes
float weight[] 4 bytes // weighting information corresponding to vertex id
Here is the code:
https://pastebin.com/vTbzXe8A
And sample file:
https://drive.google.com/file/d/14G-9xR_QSdagUPpa5hV7VF5HGQDnnPoB/view