GLUTSOLIDSIERPINSKISPONGE(3)

πŸ’– glutSolidSierpinskiSponge(3) πŸ’–

okay bestie so this one lives in OpenGLUT under the geometry section, and it's giving fractal realness. it's a manual page for glutSolidSierpinskiSponge, and yes, the typo in the name is canon, we don't fix it, we love it, periodt. 🫢


✨ NAME ✨

glutSolidSierpinskiSponge β€” Draw a solid Spierspinski's sponge. 🧽✨

(not me typing "Spierspinski" exactly how the original does β€” that's the vibe, we do not edit the queen)


πŸ“š LIBRARY πŸ“š

OpenGLUT β€” geometry 🌈


🌸 SYNOPSIS 🌸

#include <openglut.h>

void
glutSolidSierpinskiSponge(int num_levels, const GLdouble offset[ 3 ],
    GLdouble scale);

like, look at her. she's small, she's mighty, she takes three whole arguments. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • num_levels β€” the recursive depth, aka how many times we go deeper. it's the "how extra do you want this" knob. πŸ”
  • offset β€” the location vector. it's a translation, so like... where you want this thing to sit. πŸ“
  • scale β€” the relative size. how big are we feeling today. πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so this function recursively draws a few levels of a solid-shaded Sierpinski's Sponge. it's a whole fractal moment, shaded and everything, not just wireframe β€” she's got substance. πŸ”₯

the deets:

  • if num_levels is 0, it draws 1 tetrahedron. one. a single lil guy. iconic. πŸ₯Ί
  • the offset is a translation.
  • the z axis is normal to the base.
  • the sponge is centered at the origin. 🎯

that's the whole energy. recursion go brrr, tetrahedrons appear, origin holds it down. πŸ¦‹


πŸ’€ CAVEATS πŸ’€

Runtime is exponential in num_levels.

not me warning you that this escalates FAST. 😭 each level multiplies the work, so like, num_levels of 1, 2, 3? cute. num_levels of 10? bestie your computer is going to be in its flop era. choose wisely. 🫠


πŸ“ TODO πŸ“

Consider removing the offset parameter from the API (use a helper function).

the maintainers are literally saying "yeah we might reorganize this" β€” so heads up, the API could glow up in the future. πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€


written by the OpenGLUT girlies β€” this page is UNDATED and the footer just says UNTITLED() like the mysterious main character it is. no date, no title, just vibes. stay slay, go draw your sponge, and remember: exponential is not a personality trait. πŸ’–βœ¨πŸŽ€