get_align_matrix(3alleg4)

✨ get_align_matrix ✨

okay bestie, welcome to the 3alleg4 corner of the Allegro manual πŸ’– this one's from the Allegro game programming library, and it's literally the glow-up machine for your matrices πŸ’…


🌸 NAME 🌸

get_align_matrix β€” rotates a matrix to align it along specified coordinate vectors. Allegro game programming library πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

void get_align_matrix(MATRIX *m, fixed xfront, yfront, zfront, fixed
xup, fixed yup, fixed zup);

πŸ’œ DESCRIPTION πŸ’œ

so what it does is, it rotates a matrix so that it's aligned along the coordinate vectors you hand it ✨

and like, plot twist: those vectors don't have to be normalized, and they don't have to be perpendicular either. lowkey chill about it fr fr. but 🚨 there is one rule, and it's giving non-negotiable:

the up and front vectors must not be equal. that's it, that's the boundary. do not test it πŸ’€

and here's the iconic lil party trick: if you pass a front vector of 0,0,-1 and an up vector of 0,1,0, you get back the identity matrix 🌈 she ate that, no cap.


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, you're so welcome 🫢 this was Allegro version 4.4.3 dropping the get_align_matrix(3alleg4) knowledge, mwah, go rotate something pretty πŸŒΈπŸ’–βœ¨