GLUTWIRESIERPINSKISPONGE(3)

πŸ’– GLUTWIRESIERPINSKISPONGE(3) πŸ’–

okay bestie so you wanna know about glutWireSierpinskiSponge? that's the manual page name, yes it's a mouthful, yes it's iconic, and yes i'm about to explain the whole thing to you with zero skips πŸ’…


🌸 NAME 🌸

glutWireSierpinskiSponge β€” draw a wireframe Spierspinski's sponge.

(not a typo, that's literally how the original spells it, i don't make the rules 🫢)


πŸ“š LIBRARY πŸ“š

OpenGLUT - geometry


✨ SYNOPSIS ✨

#include <openglut.h>

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

like. look at that signature. gorgeous. no cap.


πŸŽ€ PARAMETERS πŸŽ€

  • num_levels β€” the recursive depth, aka how many times it goes deeper into the fractal hole πŸŒ€
  • offset β€” the location vector, it's the translation, okay?
  • scale β€” the relative size. how big we talkin'.

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this function recursively draws a few levels of Sierpinski's Sponge, and it does it in wireframe. that's the vibe.

if num_levels is 0, it draws 1 tetrahedron. one. singular. humble. main character.

the offset is a translation. the z axis is normal to the base (iykyk). and the sponge is centered at the origin β€” like everything good in this world πŸ’–


😭 CAVEATS 😭

bestie. listen. the runtime is exponential in num_levels. exponential!! do not just crank that number up and walk away. your computer will simply perish. it's giving "why is my fan screaming" energy. respect the exponent πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page fr fr 🌈

source: OpenGLUT β€” geometry, dated UNDATED, and the footer was just out here saying UNTITLED() like a little mystery. slay. go draw your sponge, bestie πŸ§šβœ¨πŸŽ€