Exporting to .x
Hi all,
I have a problem exporting meshes to .x files:
Even if I (re-)center the object center, when I import the mesh to my DirectX app, the object rotates strangely.
I tested this by creating a 1 x 1 x 1 size cube, centered in origin.
If I rotate it about the z-axis, the rotation center seems to be off a bit, so the cube appears to move. When I do the same thing with a cube created with the mesh viewer that comes with the DirectX SDK, it rotates perfectly around the center.
I calculate the bounding box for the mesh with the D3DX function D3DXComputeBoundingBox, and then I calculate the center by
cnt = (min + max) / 2
Since I'm quite new to DirectX the bug is probably in my code. Does anyone have any idea of how to fix this?
Thanks,
M
|