gleExtrusion(3GLE)

✨ gleExtrusion ✨

okay bestie, welcome to the GLE corner of the man pages, this one is gleExtrusion(3GLE) and it is literally the glow-up your 2D shapes have been waiting for πŸ’…


🌸 NAME 🌸

gleExtrusion β€” extrude an arbitrary 2D contour along an arbitrary 3D path. yes bestie, arbitrary on both sides, we contain multitudes πŸ¦‹


✨ SYNTAX ✨

void gleExtrusion (int ncp,
                gleDouble contour[][2],
                gleDouble cont_normal[][2],
                gleDouble up[3],
                int npoints,
                gleDouble point_array[][3],
                float color_array[][3]);

πŸŽ€ ARGUMENTS πŸŽ€

  • ncp β€” number of contour points. how many lil guys are in your contour, fr fr.
  • contour β€” the 2D contour itself. this is the shape getting yeeted along the path.
  • cont_normal β€” the 2D contour normals. the directional vibe of each contour point.
  • up β€” up vector for the contour. tells the contour's y-axis where "up" is in real 3D space.
  • npoints β€” numpoints in the poly-line. the count of vertices in your path.
  • point_array β€” polyline vertices. this is the actual path the contour rides along, main character energy πŸš€
  • color_array β€” colors at polyline verts. per-vertex color drip.

πŸ’– DESCRIPTION πŸ’–

So here's the tea: gleExtrusion extrudes an arbitrary 2D contour along an arbitrary 3D path. The argument contour specifies the 2D contour to be extruded, while the argument point_array specifies the path along which to extrude. And the vector up defines the orientation of the contour y-axis in real 3D space. like, it's giving geometry with attitude.

⚠️ now pay attention because this one is a sneaky lil trap: neither the very first segment, nor the very last segment are drawn. The first and last segments serve only to define the angle of the join at the very ends of the polyline. So the math is: to draw one segment, three must be specified. To draw two segments, four must be specified, etc. not me getting jumpscared by that the first time 😭 the segments are there for vibes only, they're scaffolding, they're the backstage crew, they do NOT walk the runway.

The normal array may be NULL. If it is, normal vectors will NOT be automatically generated, and the object will look terrible when lit. πŸ’€ i said what i said. no normals, no shading, just a sad flat blob under the lights. you have been warned, bestie.

The color array may be NULL. If NULL, the current color is used. If not NULL, the glColor3f() routine is used to set the color; therefore, specifying the glColorMaterial() subroutine before this primitive can be used to set diffuse, specular, ambient, etc. colors. so yeah, you can absolutely curate the whole lighting lewk before you call this 🎨✨


πŸ¦‹ SEE ALSO πŸ¦‹

  • gleTwistExtrusion
  • gleSuperExtrusion

(they're the cousins, go say hi πŸ‘‘)


🌈 AUTHOR 🌈

Linas Vepstas (linas@linas.org) β€” thank you for the shapes, king 🫢


okay that's the whole page, mwah πŸ’‹ this was brought to you by GLE version 3.0, so go forth and extrude responsibly, bestie. periodt. πŸ’…βœ¨