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