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 πΈπβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms