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

## Recommended Posts

Hi! I have written a 3DS file loader. If a file contains only one mesh it works fine. But if a file contains more meshed, they get split up into many pieces. Before I implemented the loading function for the local coordinate system it worked fine. Therefore I am sure that the problem has to do with the local coordinate system. I load this matrix in the following order:
			localCoordinateSystem.a11 = fis->readFloat32();
localCoordinateSystem.a41 = 0.0f;
localCoordinateSystem.a42 = 0.0f;
localCoordinateSystem.a43 = 0.0f;
localCoordinateSystem.a44 = 1.0f;

The first digit after the "a" is the row (1-based) and the second one is the column. Afterwards I multiply this matrix with every vertex in my model. The multiplication looks like this (pseudo-code):
	new_X = a11*x + a12*y + a13*z + a14*1;
new_Y = a21*x + a22*y + a23*z + a24*1;
new_Z = a31*x + a32*y + a33*z + a34*1;

I think this should be true, but it does not work. If I replace all values of the last column of this matrix by 0 the result is better, but still not perfect. Does anybody see the mistake? PS: Before I pass the final vertices to DirectX I swap the y- and the z-component of all vertices, since 3DS has swapped these two axis. Thanks in advance. rgds.