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 π
dot_product(3alleg4)β the other product, the one that's giving scalar energy πpolygon_z_normal(3alleg4)β the one that actually puts your normals to work πnormalize_vector(3alleg4)β so your vectors don't get too long for their own good πexstars(3alleg4)β an example, go look at it, fr fr π
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!! π¦
π¦ 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