We are trying to import an md5 model into a game. When we do so, the camera does not rotate around the player correctly: it rotates around the player but the camera points in the same direction regardless of its rotation around the model. It is almost like the camera is looking at something beyond the player, but is still rotating around the player. We are using the jME chase camera.
The model is properly formed and the animations work fine. If we load the model as an un-animated .obj file, the camera works correctly. Can anyone help? Has anyone had any similar problems?
I had problem with md5 when I exported it from 3DsMax and used in JME cuz max used left-handed coordinate system and JME used right-handed or vise versa I dont remember.
I think that's the issue in your case also. I got it fixed by manually making rotation and translation nodes to put the model to the right place with right rotation. But that's not a very nice fix, but it worked for me. You can check about translation and rotation from a wiki tutorial.
So you try when u load animated md5 model, put some cube or line to the point where player is supposed to be and I think you should see that where camera points JME thinks the model is.
The case could also be that if you are not using max but blender then your model is not centered at 0.
We are using Blender and the model's feet are centered at the origin. Should the model be centered differently?
I do not think it is a rotation problem because we are rotating the model in our code and the same problem occurs regardless of how we rotate the model.
I forgot to mention in my last post that the camera does not rotate "up" or "down" (it only rotates around the Y-axis) even though we have set ThirdPersonMouseLook.PROP_MAXASCENT to FastMath.DEG_TO_RAD * 80. Also, the camera does not follow the player; and as we move him closer to the camera the camera's radius of rotation around the player shrinks. When we move the player past the camera or "behind" it, the camera rotates around a very small radius so that it almost looks like its shaking. Also, the zoom does not work.
We uploaded a video of the camera working correctly with a .obj model and a video of the camera working incorrectly with the md5 model.
Camera working correctly: http://s830.photobucket.com/albums/zz230/WarehouseTrainer/?action=view¤t=right.flv
Camera working incorrectly: http://s830.photobucket.com/albums/zz230/WarehouseTrainer/?action=view¤t=wrong.flv
Henri said:
So you try when u load animated md5 model, put some cube or line to the point where player is supposed to be and I think you should see that where camera points JME thinks the model is.
We tried this (or something similar) and it seems to work. We have a Player that extends Node. We set its child to a square and then set its second child to the md5 model.
When we do this, the camera problem seems to go away. This really just bypasses the problem, so I would still be interested in hearing any opinions on what the problem actually is.
Thanks for you help.