Hello,
I have a problem with the animation in jPCT:
I loaded a file .3ds in an 3dObject (body) and I added it into the world.
Then i loaded 6 file .3ds in 6 3dObject (marche1, marche2,....): they are my 3d sprites.
I also created a new animation with the 3d sprites:
theWorld.addObject(body);
animation = new Animation(6);
int marcheseq = animation.createSubSequence("marche");
body.build();
marche1.build();
marche2.build();
marche3.build();
marche4.build();
marche5.build();
marche6.build();
animation.addKeyFrame(marche1.getMesh());
animation.addKeyFrame(marche2.getMesh());
animation.addKeyFrame(marche3.getMesh());
animation.addKeyFrame(marche4.getMesh());
animation.addKeyFrame(marche5.getMesh());
animation.addKeyFrame(marche6.getMesh());
body.setAnimationSequence(animation);
Loader.setVertexOptimization(false);
To finish I run my animation:
while (!exit)
{
buffer.clear();
theWorld.renderScene(buffer);
theWorld.draw(buffer);
buffer.update();
buffer.display(frameGraphics);
body.animate(x, marcheseq);
if (x>6) {
anim=0;
}
else
{
anim+=1;
}
}
}
My character appears on the screen (body) but the animation don't start(I have no errors), why?
Someone can help me?
Thanks.