GLUTESSNORMAL(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ¦‹ GLUTESSNORMAL(3G) πŸ¦‹

ok so bestie, welcome to the GLUTESSNORMAL(3G) page πŸ’– this one's short and sweet, but it's doing real work, no cap.


✨ NAME ✨

gluTessNormal β€” specify a normal for a polygon


🌸 C SPECIFICATION 🌸

void gluTessNormal( GLUtesselator* tess,
                    GLdouble valueX,
                    GLdouble valueY,
                    GLdouble valueZ )

πŸŽ€ PARAMETERS πŸŽ€

  • tess β€” the tessellation object, iykyk. You make it with gluNewTess.
  • valueX β€” the first component of the normal. that's the x one πŸ’«
  • valueY β€” the second component of the normal. the y one 🫢
  • valueZ β€” the third component of the normal. and the z one, obviously ✨

πŸ’… DESCRIPTION πŸ’…

So gluTessNormal describes a normal for a polygon that your program is defining. Very demure, very mindful.

Here's the tea: all input data gets projected onto a plane perpendicular to one of the three coordinate axes before tessellation, and all output triangles will be oriented CCW with respect to the normal. Want CW instead? Just reverse the sign of the normal you supply. That's it, that's the whole trick 🧚

For example β€” say you already know all your polygons live in the x-y plane. Then you call:

gluTessNormal(tess, 0.0, 0.0, 1.0)

before you render any polygons. easy πŸ’–

Now, if the normal you supply is (0.0, 0.0, 0.0) β€” which is the initial value, so this is the default behavior, bestie β€” then the normal gets determined like this:

  • The direction of the normal, up to its sign, is found by fitting a plane to the vertices, without regard to how the vertices are connected. it's giving "we don't care about your topology, we care about your vibes."
  • It is expected that the input data lies approximately in the plane. Otherwise, projection perpendicular to one of the three coordinate axes may substantially change the geometry. πŸ‘€ so like, heads up.
  • The sign of the normal is chosen so that the sum of the signed areas of all input contours is nonnegative β€” where a CCW contour has positive area. math slay πŸ’…
And the supplied normal? It persists until it's changed by another call to gluTessNormal. It doesn't reset on you, it just stays there, main character energy, until you say otherwise.

πŸ‘‘ SEE ALSO πŸ‘‘

  • gluTessBeginPolygon(3G)
  • gluTessEndPolygon(3G)

ok that's the whole page bestie, go forth and tessellate responsibly 🌈 this was GLUTESSNORMAL(3G), literally iconic, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from