I've created a .g3db animation file using Blender and fbxconv. Now, my libGDX project source code looks something like this:
public class test implements ApplicationListener {
// ...
public ModelInstance fred
public AnimationController animationController;
public void create () {
modelBatch = new ModelBatch();
// ...
assets = new AssetManager();
assets.load("data/fred.g3db", Model.class);
loading = true;
}
private void doneLoading() {
Model fredData = assets.get("data/fred.g3db", Model.class);
fred = new ModelInstance(fredData);
animationController = new AnimationController(fred);
animationController.animate(fred.animations.get(0).id, -1, 1f, null, 0.2f);
loading = false;
}
public void render () {
if (loading && assets.update())
doneLoading();
camController.update();
Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
if(!loading) {
animationController.update(10);
modelBatch.begin(cam);
modelBatch.render(fred,lights);
modelBatch.end();
}
}
// [...]
}
When I open this game, the model shows up perfectly, but there's no animation at all. I'm relatively new to libGDX game programming, so I have no ideas where I could have gone wrong. Any ideas?
(I don't know if this has something to do with anything, but when I converted the fbx file using fbxconv, I got several warnings, all looking like this:
WARNING: Node XXX uses RrSs mode, transformation might be incorrect.
But if what I read about this warning is true, it shouldn't actually cause any problems...)