GameMaker: Basic 3d bone animations

This example demonstrates how to create fairly basic bones for use in GameMaker 3d games fairly easily. Such can be used for character and environment animations, provided that they can be split in rotatable parts to some extent.

Advantages

As you may know, GameMaker does not quite support vertex animations. That means that models have to be either composed on-fly (which is a slow method), or "baked" as a number per-frame models (which takes amounts of memory proportional to how smooth you want your animations look). Bone animations, on other hand, work fast (since only transformation calculations need to be done), and require small amounts of memory.

Implementation

Idea of bone transformations is that you have so called bones, which can be attached to other bones, which makes them rotate together. That means, to find transformation matrix (position, rotation, and scale) of any given bone, you need to go through all of its "parent" bones, combining matrices. Normally this would be a slightly tricky task (especially if engine of choice does not have matrix operations built in), but, fortunately, GameMaker includes a set of functions to manipulate matrices (d3d_transform_).

Attached example includes a minimal system for linking bones together, drawing them, and a sort of procedural animation example.

Download GMK

Related posts:

6 thoughts on “GameMaker: Basic 3d bone animations

    • I have a Russian version of the website because I know Russian. That said, these days I mostly only post there if an article is primarily aimed at that audience or if it comes up often enough to justify translating it.

      If you want to translate something, you can do so – as per footer, the articles are licensed under CC-BY-NC-SA, so you can translate and post them on your own website so long as you keep a link to the original article and don’t insert adverts over them.

    • Depending on what you mean, you would likely need a shader for that. Fortunately, a few of those should be showing up when searching on the subject.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.