PDA

View Full Version : MD2 Animation



Petr Schreiber
26-07-2008, 20:52
Hi all,

Mike did awesome job on B3D, but TBGL needs update on bone system to be able to represent that format at 100%.
B3D is bone based, which has advantage in small file size and possible real time animation of the model.

But sometimes we want just to preanimate some moves in editor, and play them ingame. This is what MD2 file format serves for. It has keyframes of all animations stored as links to vertex positions.

I consider MD2 as candidate for pick-and-go animation for TBGL, when not advanced functionalities and realtime bone changes are needed ( such a advanced case will be handled once TBGL will be tuned well for bones ).

So here comes my first humble approach to load MD2 files. It is highly experimental, some things do not work 100% yet.

Attached file will show complete loaded MD2 file, textured, lighted and all its animations.
Once I will examine all mysteries of MD2, it will probably come as very easy to use command for TBGL, running at native speed.

But speed in ThinBasic is also not bad too; although animation seems jumpy, it is because script plays just keyframes without any kind of interpolation. Hope you will like it, take it as little demo of things to come in future.


Petr

kryton9
27-07-2008, 00:55
Hey Petr, that is a great start. Thanks for bringing this feature to us!!
Seeing Tris move like that is funny, looks like dancing a wild dance :)

This is very exciting start to your list of things for tbgl, thanks again!

Oh, you are right about truespace being slow on slower cards, I installed it on the eeepc and it is slowwwww.
So took it off, but on the HP desktop it runs fine.

Petr Schreiber
27-07-2008, 08:16
I am currently enslaving asking my brother to explore possibilities of creation of MD2 and B3D models using Milkshape 3D. It is good to have support for more formats, but if there would not be any ways to create MD2 except using those from Quake 2 it would have no point. So far it looks good with Milkshape for both MD2 and B3D = geometry can be exported without struggle. Animations ... that is another story, but lets be optimistic :)


Petr

kryton9
28-07-2008, 03:47
I think Blender exports to md2 or 3, when I reinstall it I will check for sure.

I don't what exports to b3d?

Petr Schreiber
28-07-2008, 09:07
I don't what exports to b3d?


I know only about Milkshape so far, but I am sure there are more. Mike will know :)


Petr

Michael Hartlef
31-07-2008, 21:31
Cool Petr, I'll test this when I'm back on the weekend. Yes, Milkshape exports to B3D, Blender does.

Michael Hartlef
04-08-2008, 13:27
Looks cool. I can't wait till we have this build into TBGL and with keyframe interpolation. That will be awesome.

Petr Schreiber
04-08-2008, 17:54
Hi Mike,

I try to make MD2 functions as easy to use as possible.
I will open new thread on the functions before hardcoding them, so we can together invent the most optimal syntax.


Petr

Michael Hartlef
05-08-2008, 06:06
That is definately a good way to do it.