I have 3ds model exported from blender and when i put it into jpct ae no errors came out but it didnt animate? i followed code to the word from other posts and cannot figure out what is wrong?
i then decided to export each animation individually and ended up with several different 3ds models and when i used their meshes as animation keyframes and applied all the key frames etc still no result? the object just sits there without animating.
animationArray.add(Loader.load3DS(getAssets().open("test1.3ds"), 15.0f)[0]);
animationArray.add(Loader.load3DS(getAssets().open("test2.3ds"), 15.0f)[0]);
animationArray.add(Loader.load3DS(getAssets().open("test3.3ds"), 15.0f)[0]);
man = new WorldObject(animationArray.get(1));
man.setOrigin(new SimpleVector(0, 0, 0));
man.build();
man.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
man.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
Animation anim = new Animation(animationArray.size());
anim.createSubSequence("walk");
for (int i = 0; i < animationArray.size(); i++) {
System.out.println("adding keyframe number " + i);
Object3D obj = animationArray.get(i);
obj.build();
Mesh msh = obj.getMesh().cloneMesh(true);
msh.strip();
anim.addKeyFrame(msh);
}
man.setAnimationSequence(anim);
man.build();
and then the animation called every frame. this is inside and extended class of Object3D (thus the this.animate(ind, an));
public void runAnimation() {
try{
ind += 0.02f;
if (ind > 1f) {
ind -= 1f;
}
this.animate(ind, an);
}catch(Exception e){
System.err.println("MoveTest::checkAnimate3DS() " + e.getMessage());
e.printStackTrace();
}
}