triangle3d(3alleg4)

πŸ’– triangle3d β€” Allegro manual πŸŽ€

okay bestie, so this is triangle3d(3alleg4) from the Allegro manual, and it's literally the glow-up your 3d triangle rendering has been waiting for ✨


🌸 NAME 🌸

triangle3d, triangle3d_f β€” draws a 3d triangle onto the bitmap you picked, no cap. part of the Allegro game programming library, obviously πŸ’…


✨ SYNOPSIS ✨

#include <allegro.h>

void triangle3d(BITMAP *bmp, int type, BITMAP *tex, V3D *v1, *v2, *v3);

void triangle3d_f(BITMAP *bmp, int type, BITMAP *tex, V3D_f *v1, *v2,
*v3);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: you're drawing 3d triangles, and you get to choose whether you're doing it with fixed point or floating point vertex structures. pick your fighter πŸ’–

now here's the tea πŸ«– β€” unlike quad3d[_f](), the triangle3d[_f]() functions are not wrappers of polygon3d[_f](). nope, they're doing their own thing. they've got their own routines that take into account the constantness of the gradients. it's giving main character energy, fr fr πŸ‘‘

and because of that, this:

triangle3d[_f](bmp, type, tex, v1, v2, v3)

is faster than this:

polygon3d[_f](bmp, type, tex, 3, v[])

speed, bestie. we love to see it ⚑

πŸ“– also! go read the beginning of chapter "Polygon rendering" for the full list of rendering types you can use with this function. iykyk, don't skip it 🌈

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, babe 🌸 go render some iconic little triangles, you've got this πŸ’œ

signing off from Allegro, version 4.4.3, dated triangle3d(3alleg4) β€” mwah πŸ’‹βœ¨