cross_product(3alleg4)

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

okay so you're reading the Allegro manual for cross_product and cross_product_f, and honestly? you're in the right place. this is from the Allegro game programming library, and we're about to calculate a cross product together. no cap. πŸŽ€


✨ NAME ✨

cross_product, cross_product_f β€” Calculates the cross product. Allegro game programming library. πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

void cross_product(fixed x1, y1, z1, x2, y2, z2, *xout, *yout, *zout);

void cross_product_f(float x1, y1, z1, x2, y2, z2, *xout, *yout, *zout);

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so the whole vibe here: this function calculates the cross product of (x1, y1, z1) Γ— (x2, y2, z2), and then it stores the result in (*xout, *yout, *zout). that's it, that's the function. ✨

and here's the part that's genuinely iconic: the cross product comes out perpendicular to both of the input vectors. like, it's literally built different β€” it points off at a right angle to both of them at the same time. 🫢

so what do you actually do with that? you use it to generate polygon normals. that's the main character use case, bestie. normals. polygons. slay. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


ngl this page is short and sweet and that's the point. it's giving minimalism. not me writing a whole essay about a cross product. πŸ’€

Allegro version 4.4.3 β€” cross_product(3alleg4), and that's the whole page, bestie. hope your normals are perpendicular and your vectors are normalized. πŸ’–βœ¨πŸŽ€ bye!! πŸ¦‹