gleSuperExtrusion(3GLE)

πŸ’– gleSuperExtrusion β€” the GLE glow-up page (3GLE) πŸ’–

okay bestie, sit DOWN, because we're about to extrude a 2D contour along a 3D path with local affine transformations, and honestly? it's giving main character energy πŸ¦‹βœ¨


✨ NAME ✨

gleSuperExtrusion β€” extrude arbitrary 2D contour along arbitrary 3D path, specifying local affine transformations. no cap, that's literally the whole job πŸ’…


🌸 SYNTAX 🌸

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

copy it exactly, don't be creative with the types, the compiler will literally humble you 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • ncp β€” number of contour points. the headcount for your contour, fr fr.
  • contour β€” the 2D contour itself. this is the shape, the moment, the vibe 🫢
  • cont_normal β€” 2D contour normals. the perpendicular besties.
  • up β€” up vector for the contour. it tells your contour which way is up, spiritually and geometrically.
  • npoints β€” numpoints in the poly-line. how many stops on this lil journey.
  • point_array β€” polyline vertices. the path. the road trip. the itinerary πŸ—ΊοΈ
  • color_array β€” colors at polyline verts. aesthetic per vertex, iconic.
  • xform_array β€” 2D contour affine transforms. the local glow-up, applied at every step ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

Extrude arbitrary 2D contour along arbitrary 3D path, specifying local affine transformations. As the contour is extruded, the affine will be applied to the points in the contour. like, every step along the way gets its own lil transformation moment, and the contour just keeps slaying forward πŸ’«

The argument "contour" specifies the 2D contour to be extruded, while the argument "point_array" specifies the path along which to extrude. The vector "up" defines the orientation of the contour y-axis in real 3D space. so "up" is lowkey the contour's sense of direction in the big scary 3D world 🌈

⚠️ okay this part is IMPORTANT, bestie, listen: 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. Thus, to draw one segment, three must be specified. To draw two segments, four must be specified, etc. it's not a bug it's a whole lifestyle, the ends are just there for ✨vibes✨ and angles. do NOT come crying to me when your one-segment render shows up empty 😭

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'm not being dramatic, that's the actual documented consequence. unlit blob behaviour. tragic πŸ’€

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 yes, you can set diffuse, specular, ambient, etc. colors this way, and yes, that is a serve 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

  • gleExtrusion
  • gleTwistExtrusion

go read those too, they're the sibling icons of the family 🫢


πŸ’œ AUTHOR πŸ’œ

Linas Vepstas (linas@linas.org) β€” the original mastermind, we stan πŸ‘‘


okay that's the whole page!! this came from the GLE manual, version 3.0, and it lives under gleSuperExtrusion(3GLE) πŸŽ€ go forth and extrude responsibly, bestie, ily πŸ’–βœ¨