Author Topic: animation problem  (Read 4017 times)

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
animation problem
« on: February 21, 2008, 06:03:18 pm »
I've just used a walk and stand animaton with sub sequences up till now and everything was working fine.  However I set up a jump, where the characters size is quite a bit different.  He's scrunched down now getting ready to leap.  Jpct makes garbage out of the model.  If I set the default model that loads at the start as the jump model, then it looks all right, but the stand and walk animations turn into garbage.

edit:  I might get that worked out by using more gradual changes, I'm not sure.  But I'm also getting an error for too many key frames defined when I get to the sixth one with this code:

Code: [Select]
    Mouse = loadModel("data/stand.3ds",1); 
// Object3D Mouse;
  Mouse.translate(0, -5, 0);
 // Mouse.createTriangleStrips();
TextureManager tm = TextureManager.getInstance();
    Texture tex=new Texture("data/fur.jpg");
    tm.addTexture("fur", tex);    
    tex = new Texture("data/red.jpg"); 
    tm.addTexture("red", tex);    
    Mouse.setTexture("fur");
world.addObject(Mouse);
  Animation mouse = new Animation(5);
  mouse.createSubSequence("walk");

  mouse.addKeyFrame(loadModel("data/walk2.3ds",1).getMesh());
  mouse.addKeyFrame(loadModel("data/walk3.3ds",1).getMesh());
  mouse.addKeyFrame(loadModel("data/walk4.3ds",1).getMesh());
  mouse.addKeyFrame(loadModel("data/walk1.3ds",1).getMesh());
  mouse.createSubSequence("stand");
  mouse.addKeyFrame(loadModel("data/jump.3ds",1).getMesh());
  mouse.addKeyFrame(loadModel("data/jump2.3ds",1).getMesh());

The last key frame gives me that error.  Doesn't seem like very many.  I was planning on using quite a few more animations.
OH  DUH!!!  I forgot I defined the animation size.  I'll get back on if the more gradual animations helped.
« Last Edit: February 21, 2008, 06:50:08 pm by fireside »
click here->Fireside 7 Games<-

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: animation problem
« Reply #1 on: February 21, 2008, 07:02:16 pm »
If keyframes are too different, the results will look very strange. That's only natural, because you can't interpolate _ to | without at least some inbetween frames and expect it to look good. Also make sure that your vertices match, i.e. what is vertex x in frame a has to be vertex x in frame b, or otherwise, hell breaks loose... ;D
« Last Edit: March 05, 2009, 06:22:45 pm by EgonOlsen »

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
Re: animation problem
« Reply #2 on: February 21, 2008, 07:15:50 pm »
Yeah, it's working better with an extra frame in the jump. 
click here->Fireside 7 Games<-