S3D_PUSH_POLYGON(3)

πŸ’… s3d_push_polygon β€” bestie, let's push a polygon

okay so this is a page from the s3d manual, and it's about exactly one thing: yeeting a polygon onto an object's polygon stack. lowkey iconic. let's get into it 🫢


✨ NAME ✨

s3d_push_polygon β€” push polygon. that's it. that's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

#include <s3d.h>

int s3d_push_polygon(int object, uint32_t v1, uint32_t v2, uint32_t v3,
                     uint32_t material);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically you're pushing one polygon onto the polygon stack of the object. that's the move. πŸ’…

it takes 3 vertex-index numbers and one material material-index-no. as arguments. like, three little numbers pointing at vertices you already pushed, plus a number pointing at a material. that's the whole squad. periodt.

and here's the demo the manpage serves up, look at her go:

int oid = s3d_new_object();   // create a new object
s3d_push_vertex(oid, 0.0, 0.0, 0.0);
s3d_push_vertex(oid, 0.0, 1.0, 0.0);
s3d_push_vertex(oid, 1.0, 0.0, 0.0);
s3d_push_material(oid, 0.3, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
s3d_push_polygon(oid, 0, 1, 2, 0);
// this will create a red polygon
not me reading that and going "oh she's RED red" πŸ˜­πŸ“ the comment literally says // this will create a red polygon β€” no cap, that's straight from the source. the material got those 0.3, 0.0, 0.0 red energy and the polygon is serving it back on vertices 0, 1, 2 with material 0. ate. πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d

like, the actual author of s3d. we stan. 🫢


and that's the whole page bestie β€” this was the S3D_PUSH_POLYGON(3) entry from the s3d manual, brought to you by the one and only s3d project. mwah, go push some polygons. πŸ’–βœ¨πŸŽ€