S3D_PEP_POLYGON_NORM(3)

πŸ’– NAME πŸ’–

s3d_pep_polygon_normals β€” bestie, this one adds normals to a polygon ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <s3d.h>

int s3d_pep_polygon_normals(int object, const float *nbuf, uint16_t n);

🌸 DESCRIPTION 🌸

okay so picture this: you want your polygons to have normal information, and not just one normal for the whole flat lil face β€” nope, this function gives each vertex of a polygon its own normal info. And the way that works out? You get smoothed edge effects. slay. πŸ”₯

So nbuf needs to hold n * 9 float values. Why 9? Because each vertex gets a normal vector (x,y,z), and there are 3 vertices per polygon, so that's 3 * 3 = 9 float values per polygon total. math ate, no crumbs. πŸ’…

ngl, if you don't use this, don't even worry about it. it's kind of hard to calculate, and the server will always use some proper normal values anyway β€” same value for every vertex, calculated by the plane which is defined by the 3 points of the polygon. so like, it's handled. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d πŸ’œ


mwah, that's the whole page bestie β€” brought to you by the s3d manual, page S3D_PEP_POLYGON_NORM(3). go smooth those edges, ily, bye! πŸ¦‹βœ¨πŸŽ€