apply_matrix(3alleg4)

πŸ’– apply_matrix β€” bestie edition πŸ’–

okay so this is apply_matrix, apply_matrix_f from the Allegro manual, section 3alleg4, and it's literally the "multiply a point by a transformation matrix" girlies πŸŽ€


✨ NAME ✨

apply_matrix, apply_matrix_f β€” Multiplies a point by a transformation matrix. Allegro game programming library. πŸ¦‹


✨ 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);

✨ DESCRIPTION ✨

ok so picture this: you have a point, right? it's just vibing at (x, y, z). 🌸 and you have a transformation matrix m. and you want the point to go through the matrix and come out the other side as a whole new point.

that's it. that's the function. πŸ’…

apply_matrix takes the point (x, y, z), multiplies it by the transformation matrix m, and drops the result into (*xout, *yout, *zout). iconic behavior, no cap. πŸ‘‘

and apply_matrix_f is the exact same thing except it's the float version β€” it takes a MATRIX_f *m and float coordinates instead of fixed ones and a MATRIX *m. same energy, different data type. ✨

heads up bestie: the results go into the pointers you pass as *xout, *yout, *zout β€” so make sure those actually point somewhere real, fr fr. πŸ™ˆ

✨ SEE ALSO ✨

go read those too, they ate. πŸ”₯


and that's the whole page, bestie 🫢 this was the Allegro manual, version 4.4.3, and yeah the original footer said apply_matrix(3alleg4) on both ends, so consider this your cute lil sign-off: Allegro 4.4.3, apply_matrix, section 3alleg4. periodt. πŸ’œ