MD2 animation

Started by Ulrick, October 28, 2010, 05:42:53 PM

Previous topic - Next topic

Ulrick

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

EgonOlsen

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.

Ulrick

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

EgonOlsen

The download might help....

Ulrick

#4
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

EgonOlsen

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.

Ulrick

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

EgonOlsen

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.