get_x_rotate_matrix(3alleg4)

πŸ’– NAME πŸ’–

get_x_rotate_matrix, get_x_rotate_matrix_f β€” bestie, these two are here to construct X axis rotation matrices. It's giving Allegro game programming library energy, as always. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

void get_x_rotate_matrix(MATRIX *m, fixed r);

void get_x_rotate_matrix_f(MATRIX_f *m, float r);

Two lil functions, same job, different float flavor. Pick your fighter. πŸ’…


πŸŒ€ DESCRIPTION πŸŒ€

okay so listen. Both of these cuties construct X axis rotation matrices and tuck them right into m. That's the whole vibe. 🫢

Then, when you apply one of those matrices to a point, it rotates that point about the X axis by the angle you handed over β€” and yes bestie, that angle is given in binary, 256 degrees to a circle format. Not your regular degrees. Not radians. The Allegro way. iykyk. πŸ”₯

So you're literally just saying "spin this thing around the X axis, this much," and the matrix does the rest. main character energy fr fr. πŸ’€βœ¨

heads up: the angle format is binary, 256 degrees to a circle β€” don't come in here with regular degrees, she will not understand you. πŸŽ€

πŸ‘‘ SEE ALSO πŸ‘‘

Go read those too, bestie, they're all part of the rotation cinematic universe. 🌈


and that's the whole page, periodt πŸ’œ this one came straight out of Allegro, version 4.4.3, filed under get_x_rotate_matrix(3alleg4) β€” slay, go rotate something. πŸ¦‹β­