Author Topic: MD2 animation  (Read 5327 times)

Offline Ulrick

  • byte
  • *
  • Posts: 18
    • View Profile
MD2 animation
« on: October 28, 2010, 05:42:53 pm »
Hi all,

as I can read from the documentation, the animation method of an Object 3d, should be used as follow:

public void animate(float index)

    Calculates a new mesh for this object based on the keyframes of its animation sequence and "index". index is a value between 0 and 1 where 0 is the first keyframe and 1 the last. Because no sub-sequence is indicated, the complete animation will be used.

    Parameters:
        index - the "time-index" into the animation

So 0 is the first keyframe and 1 is the lastone.

In my case, it seems not to work correctly. 0 seems to be ok, but as for the last keyframe, seems like 1 is not correct as my animation seems actually to freeze for a while and then restart. If I lower the limit value to something around 0.32 o 0.34 it seems to work correctly (not really but it is better).

Can anyone give me some hints on how to use it?

Thanks a lot,

Ulrick

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: MD2 animation
« Reply #1 on: October 28, 2010, 08:47:11 pm »
I've no idea what your md2 looks like, but try to set the clamping mode to wrapping (should actually be default, but who knows...) and see if that gives you the desired result. Also keep in mind that a usual md2 file contains many sequences in one file.

Offline Ulrick

  • byte
  • *
  • Posts: 18
    • View Profile
Re: MD2 animation
« Reply #2 on: October 29, 2010, 03:38:33 pm »
Thanks EgonOlsen, it is a simple MD2 I made with Blender.

What do you mean by "set the clamping mode to wrapping"?

Is it a JPCT command? I cannot find it.

Thanks a lot,

Ulrick

P.S. if you want I can post a link to download it

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: MD2 animation
« Reply #3 on: October 29, 2010, 04:25:25 pm »
The download might help....

Offline Ulrick

  • byte
  • *
  • Posts: 18
    • View Profile
Re: MD2 animation
« Reply #4 on: October 29, 2010, 05:10:26 pm »
Ok,

then go to this web site (my own) and get bougth files you see there:

http://ulrick.homelinux.com/down/

One is the md2 and the second one is the texture.

Forgot to place the .blend (just added).

Thanks a lot,

Ulrick

P.S. btw if you go to this web site you can see what I'm working on
http://ulrick.homelinux.com
« Last Edit: October 29, 2010, 05:13:13 pm by Ulrick »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: MD2 animation
« Reply #5 on: October 29, 2010, 09:25:25 pm »
Well, i loaded this model into some MD2 model viewer and the animation looks exactly like you've described it....it plays fine for some time but then there's no change in the keyframes anymore until it loops again. Looks like as if Blender simply exported a faulty animation. Even more as the backface culling isn't correct. If it's activated, some polygons are missing that should actually be there.

Offline Ulrick

  • byte
  • *
  • Posts: 18
    • View Profile
Re: MD2 animation
« Reply #6 on: October 30, 2010, 12:11:08 am »
Ok,

I thought it was correct. As you probably understood, I just started using blender
, so I probably missed something.

Anyway the animation looks correct and there are no issues with backface as far as I understood (sorry, but I actually didn't understand what you mean by activating backface culling).

what software do you use to check md2 files?

Thanks anyway,

Ulrick

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: MD2 animation
« Reply #7 on: October 30, 2010, 08:19:19 pm »
No idea about the name and no chance to check it as i'm not at home. It is just something that google came up with when searching for an md2 viewer.