get_trans...ion_matrix(3alleg4)

๐Ÿ’– get_transformation_matrix ๐Ÿ’–

ok so bestie, this one's from the Allegro manual (the game programming library, you know the vibe ๐ŸŽฎโœจ), and it's genuinely one of those functions that makes 3D stuff go brrr. Let me put you on.


โœจ NAME โœจ

get_transformation_matrix โ€” constructs X, Y, Z rotation matrices with an angle and scaling. it's giving Allegro game programming library energy fr fr ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <allegro.h>

void get_transformation_matrix(MATRIX *m, fixed scale, fixed xrot, yrot,
zrot, x, y, z);

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so here's the tea โ˜• โ€” this function builds you a transformation matrix, and that matrix is about to do three things to your points, in order, no skipping:

  • rotate them around all three axes by the amounts you pass in (and heads up, those angles are in binary, 256 degrees to a circle format โ€” not your regular degrees, bestie, don't get caught slipping ๐Ÿ˜ญ)
  • scale the result by the amount you specify โ€” and listen, if you want no change of scale, you pass 1. that's it. 1. periodt ๐Ÿ’…
  • then translate to the x, y, z position you asked for

so it's rotate โ†’ scale โ†’ translate, and you get one shiny MATRIX out of it. iconic behavior honestly ๐Ÿ‘‘


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

like obviously you're gonna need the rest of the squad:


and that's the whole page, no notes ๐Ÿซถ

this was brought to you by Allegro version 4.4.3 โ€” yeah she's been around a minute but she still slays, okurrr ๐Ÿ’–โœจ๐ŸŒˆ go make something cute in 3D for me, mwah ๐ŸŽ€