Animation

Animation notes:

Make a glTF model if you want to make something animated, OBJ models don't support animations. Your glTF scene can have multiple meshes in it, but they can't have scene graph transformations (translation on rotation) because Raylib doesn't understand those, everything must be based in the origin and have its translation baked into vertices. Only skeletal animation is supported. The default animation an object is always running is hardcoded as the animation named "idle".

If you're making a simple animation like a rotating wheel, you can do it as skeletal animation like this: Create an armature with two bones, name them "inert" and "rotor" for example. Parent the model into the armature using the "with empty groups" option. Create a vertex group also named "rotor" and assign rotating part's vertices to that. Assign the rest of the vertices to an "inert" group. Named vertex groups should map the model to bones.

Animate rotation doing posed animation with the "rotor" bone, don't touch the "inert" bone.

Final gotcha, Blender outputs glTF animations which make Raylib crap out. Make sure to export as ".gltf", not ".glb". Manually edit the output .gltf file and change every instance of "STEP" to "LINEAR" (you want a text editor with a good global search/replace function here). Raylib can't handle "STEP" type values in animations. TODO: Is there a Blender-side setting that forces it to not output "STEP" bits?

Also there's this basically undocumented tool I made for messing around with glTFs, roundtrip with that will fix the STEP stuff, also may mung the whole model because bugs. https://github.com/rsaarelm/gltfunroll