Category: 2D Overlay
Syntax:
b2dMeshAnimate:Void(handle:Int, frameA:Int, frameB:Int, t:Double)
Void
Sets the mesh's current pose to frameA blended towards frameB by
t. The next b2dMeshCopyVertsX/Y/Z calls read that
pose.
To play an animation, advance a time each frame, turn it into a frame position, and blend the frame
you are on with the next one by the fraction in between — that gives smooth motion however
few frames the model has.
Frames are clamped to 0 .. b2dMeshFrameCount - 1 and
t to 0..1, and nothing else is enforced: any two frames can be blended, whether or
not they belong to the same clip. That matters because clips cannot always be trusted — some
exporters write the whole animation as every clip — so looping a hand-picked range of frame
numbers is the reliable way to play one motion. Frame numbers are the converter's baked frames, not
the frame numbers in the modelling program — the IDE's mesh converter (Tools → GLB to .bb3d
Mesh Converter) offers a preview after each bake for reading them off.
View detailed documentation online
; loop frames 40..63 at 12 frames per second animTime = animTime + dt Local pos:Double = animTime * 12.0 Local whole:Int = ToInt(pos) Local fi:Int = whole Mod 24 b2dMeshAnimate(mesh, 40 + fi, 40 + ((fi + 1) Mod 24), pos - ToDouble(whole))
See examples/Runtime/30 - Meshes.
BambooBasic © 2026 Michael Denathorn