Rigging 3D models in Codea - First animation

@matkatmusic - thank you for that, but I don’t want to spend the rest of my life trying to follow the Quake 3 code! (Besides, I don’t think you can export bones from Blender).

@Ignatz that looks really impressive, @SkyTheCoder, one way to do facial animation (and simple model animation) is to simply work with the actual vertex points themselves, move them to new positions and then do a linear interpolation (morph) between the points.

We did that in one of the first games I worked on (Cybermorph and Battlemorph on the Atari Jaguar). In game the wings on the players ship would sweep forward and back as the player slowed down and sped up. To achieve the effect there were three different models (wings back, normal and forward) with back and forward being copies of normal but with the vertext points just dragged into different places (so all the faces etc were all the same), the code then simply interpolated the vertex list to create the required model frame.

@ignatz

Blender can export bones in the md5 format:
http://www.katsbits.com/smforum/index.php?topic=178.0

Use the Doom source code to see how to load in the md5 format if it’s not plain-text. but there ya go.

here’s the code for md5anim processing:
https://github.com/TTimo/doom3.gpl/blob/8047099afdfc5c973faa67a04f601a014de0fa73/neo/d3xp/anim/Anim.cpp

and the main header for anim processing:
https://github.com/TTimo/doom3.gpl/blob/8047099afdfc5c973faa67a04f601a014de0fa73/neo/d3xp/anim/Anim.h Check out the class “idAnimator” dedicated to handling the animations stored in the md5anim files

@TechDojo I tried that a long time ago, when you get more vertices it’s horribly laggy.

@matkatmusic - thank you again, that is interesting, and I wasn’t aware md5 was in readable form or I would have looked at it.

It uses weights to set vertex positions, which is simply too slow in Codea unless it is somehow done in a shader. It also uses bit positions for animations, and bits aren’t supported in Codea yet. Altogether too much work, and I’m not going to build a game with it anyway, so it doesn’t really matter.

So I’m going to leave that to someone else, my life isn’t long enough to master all that code.

But thank you for going to the effort of finding those links, much appreciated, and I wish I’d known about that sooner, because it has some valuable suggestions.

@SkyTheCoder, I remember the days when low poly models were all you had :slight_smile:
I agree dynamically changing data like that in Lua can get messy - it was much easier in Assembler, where you can poke directly into memory buffers with out any dynamic allocation :slight_smile:

@ignatz check this out: http://springrts.com/phpbb/viewtopic.php?f=23&t=20214&view=next

@matkatmusic - interesting - they didn’t succeed, though

@ignatz, he posted a video of it succeeding on page 3: http://www.youtube.com/watch?v=JwL67-loGWU

pretty good, but I still reckon that’s the slow way to do it

well, it’s the tradeoff of the ease of creating assets in Blender/3DS/Maya and using them in a difficult environment that doesn’t natively support those types of assets.