Original Post
I am working on a function to load a MS3D-model into my application, but something seems to be wrong when I get to the joints. I have loaded everything (vertices, triangles, materials, meshes) and tried to render (and it works OK). But I allways get the value 0 when I try to read the 2 byte integer with the number of joints. I am trying to load a pre-animated MS3D-file from the source code of the book "Focus on 3D Models" by Pipho, so there should be joints in the file. Pseudocode of my loading function:
read file into byte-array
read and verify header
read numVertices
loop through and read vertices
read numFaces
loop through and read faces
read numMeshes
loop through and read meshes
read numMaterials
loop through and read materials
read numJoints
...
And here is the output from my code (with number of elements in paranthesis): Quote:Are there any hidden bytes between the Materials and the Joints? :S
Loading SMD3 File: data/thug.ms3d File Header Valid - File Size: 89713 bytes. Reading Vertices (502). Data left: 89697 bytes. Reading Triangles (982). Data left: 82165 bytes. Reading Meshes (14). Data left: 13423 bytes. Reading Materials (2). Data left: 10953 bytes. Reading Joints (0). Data left: 10229 bytes.