apply_matrix(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ apply_matrix(3) ✨

okay bestie, we're doing an Allegro manual page today, and it's a short one but it's so useful. sit down, grab a strawberry, let's go πŸ“


πŸ’– NAME πŸ’–

apply_matrix, apply_matrix_f β€” literally multiplies a point by a transformation matrix. that's the whole vibe. also: it lives in the Allegro game programming library, so it's giving game-dev main character energy πŸ‘‘


🌸 SYNOPSIS 🌸

#include <allegro.h>

void apply_matrix(const MATRIX *m, fixed x, y, z, *xout, *yout, *zout);

void apply_matrix_f(const MATRIX_f *m, float x, y, z, *xout, *yout,
*zout);

yes the two functions are twins, no cap. one is the fixed girlie, one is the float girlie πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: you've got a point (x, y, z) and you've got a transformation matrix m. this function takes that point, multiplies it by that matrix, and drops the result into (*xout, *yout, *zout).

that's it. that's the function. it ate and left no crumbs ✨

like β€” you hand it the point, it hands you back where the point ends up after the transformation. the way that works is genuinely so satisfying ngl 🫢


πŸ‘€ SEE ALSO πŸ‘€

go read those if you want the full lore, iykyk πŸ’œ


reminder bestie: this page is from Allegro version 4.4.3 πŸŽ€ that's the source and the version, noted and slayed. mwah, bye! πŸ’–πŸŒˆβ­
πŸ“¦ where this page comes from