Surface/vertex error with B3d loader

Archives Forums/Blitz3D Bug Reports/Surface/vertex error with B3d loader

GrumpyOldMan(Posted 2005) [#1]
When a mesh is loaded with either LoadMesh or LoadAnimMesh there seemes to be random reassignment of vertex numbers/positions.

Below is a modified version of Peter Scheutz's B3d to XML to B3d program that shows what's recorded within the B3d file doesn't correspond to what's loaded.




jfk EO-11110(Posted 2005) [#2]
This may have something to do with the fact that DX is assigning the Surfaces in random order. I even think the vertex assigning is correct, but you are investigating the wrong surfaces?

You can identify the surfaces by the texturepaths they use, check out the SaveB3D example in the archives.


Beaker(Posted 2005) [#3]
Please try and use the codebox tags for long code snippets.


GrumpyOldMan(Posted 2005) [#4]
jfk

I'm using the test on a single surface mesh so there's no problem with getting the surfaces mixed up. If you run the test on any mesh you'll find that the xyz values stored in the .b3d are not what's listed when you examine the surface. It seems to transpose values for two adjacent vertices at irregular intervals. This can be extremely frustrating if you are trying to use mesh transformation/animation or vertex manipulation and the wrong bits are affected.

Here's a sample from a previous vertex_debug.txt I did. It's from the second part that shows the vertices assigned to a bone (first identifier) and the .b3d stored values (first three values) and the surface values (last three values):-

bone_Lupperarm
114 -0.509136 0.566088 -0.037949
-0.509136 0.566088 -0.037949

115 -0.475962 0.512421 0.052254
-0.755178 0.49754 0.029134

122 -0.509131 0.446608 -0.037958
-0.509131 0.446608 -0.037958

123 -0.470354 0.5 -0.086906
-0.767302 0.497315 -0.047245


Beaker

Mea culpa. I stand rightfully admonished and will now always use the codebox tags.

Cheers

GrumpyOldMan


jfk EO-11110(Posted 2005) [#5]
Ok, I see. Sorry, I have no idea why this happens. Maybe Mr. Sibly knows what's going on. you may also try to build the mesh from scatch with vertex data from your perosnal file format. (tho I am not sure if you can do everything you want when bones are involved).


GrumpyOldMan(Posted 2005) [#6]
Hi jfk

Thanks for the reply. Since I was going to be using the bones only from b3d's for matrix transformations of meshes, it's no great loss. Only it would have been handy to be able to rely on the b3d loader to load a mesh as recorded instead of coming up with my own mesh format and loader.

Cheers

GrumpyOldMan