PDA

View Full Version : External MD2 support for TBGL



Petr Schreiber
01-01-2009, 10:13
Dear friends!,

welcome to new year! Because learning from history is often useful, I bring some granny-tech :)

I think at least some of gaming patriarchs remember era of Quake 2 engine - Quake 2, Anachronox, Kingpin...

These games used MD2 animation system, or its derivation.
During the last few days I decided to attempt to work on system handling classic MD2 animated models.

As I realize MD2 is historical technology, I decided to not include it as part of TBGL, but make separate DLL - those who want to try it can pick it separately and use with TBGL.

Good news for someone could be that I decided to release source code of MD2Plus, as I named the library, so everyone can get scared by coding done under influence of Xmas cookies overdose :) and modify it. Library is written in PowerBASIC for Windows, v9.

All functions are documented via PDF manual, and I preparied few elemental examples to get you started.

I tried to keep it simple, so you can load, draw and delete the MD2's. You can also set active animation loop and iterate through the frames both back and forth.

Hope you will like it, and I would be even happier to see some game using this library in the future ;)


Petr

There were typos in the manual, I uploaded new version

Michael Hartlef
01-01-2009, 13:05
thanks Petr for providing this. I don't own PB9 but for sure it will be an interesting study of your sources.

Michael

Petr Schreiber
01-01-2009, 14:36
Mike,

I use new features of PB9 mainly for the data storage and management of common model data. If it would be problem for you, I can rewrite it to something with custom memory allocation. It would loose a bit of clarity, but would work.

Sources are not exactly state of the art, but I tried to comment frequently :)


Petr

zlatkoAB
01-01-2009, 14:48
Hi Petr...
This MD2 .dll looks great :)
Thanks for sharing source code ,very interesting.
And all best for New Year... ;)

Zlatko

And also all best for you Mike... :)

ErosOlmi
01-01-2009, 15:18
Thanks a lot Petr. Very generous.
It is a great piece of code that can be used as a base for a community project.
Maybe other PBrs will be interested in your code ;)

I have to say that thinBasic source code still have to take advantages of the new PB9 features like CLASSes.
But I will recover this gap once thinBasic version 2.x will be in production.

Ciao
Eros

Michael Hartlef
01-01-2009, 18:17
And also all best for you Mike... :)


Thanks Zlatko, you too!

@Petr, no need to convert this for me.