GLNORMAL(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay bestie, welcome to the GLNORMAL page from the 3G section of the manual πŸ’… β€” this is the one about setting the current normal vector. The whole girl-group is here:

glNormal3b, glNormal3d, glNormal3f, glNormal3i, glNormal3s, glNormal3bv, glNormal3dv, glNormal3fv, glNormal3iv, glNormal3sv


✨ C SPECIFICATION ✨

void glNormal3b( GLbyte nx,
                 GLbyte ny,
                 GLbyte nz )
void glNormal3d( GLdouble nx,
                 GLdouble ny,
                 GLdouble nz )
void glNormal3f( GLfloat nx,
                 GLfloat ny,
                 GLfloat nz )
void glNormal3i( GLint nx,
                 GLint ny,
                 GLint nz )
void glNormal3s( GLshort nx,
                 GLshort ny,
                 GLshort nz )

πŸŽ€ PARAMETERS πŸŽ€

  • nx, ny, nz β€” these three girlies are the x, y, and z coordinates of your brand-new current normal ✨. And the very first one, before you've touched anything? She's the unit vector, (0, 0, 1). That's the initial value, no cap.

✨ C SPECIFICATION ✨ (the pointer edition 🫢)

void glNormal3bv( const GLbyte *v )
void glNormal3dv( const GLdouble *v )
void glNormal3fv( const GLfloat *v )
void glNormal3iv( const GLint *v )
void glNormal3sv( const GLshort *v )

πŸŽ€ PARAMETERS πŸŽ€

  • v β€” this one's a pointer, bestie 🎯. It points to an array of three elements: the x, y, and z coordinates of the new current normal.

πŸ¦‹ DESCRIPTION πŸ¦‹

The current normal gets set to whatever coordinates you hand over, every single time glNormal is issued. periodt. πŸ’…

Now here's the tea πŸ“: byte, short, or integer arguments get converted to floating-point with a linear mapping that maps the most positive representable integer value to 1.0, and the most negative representable integer value to -1.0. Slay, math.

Normals specified with glNormal need not have unit length β€” she does NOT have to be a unit vector, and that's fine πŸ’–. But if GL_NORMALIZE is enabled, then normals of any length specified with glNormal are normalized after transformation. And if GL_RESCALE_NORMAL is enabled, normals are scaled by a scaling factor derived from the modelview matrix.

okay but listen 🚨 β€” GL_RESCALE_NORMAL requires that the originally specified normals were of unit length, and that the modelview matrix contain only uniform scales for proper results. Like, that's the whole vibe check. Ignore it and it's giving chaos.

To enable and disable normalization, call glEnable and glDisable with either GL_NORMALIZE or GL_RESCALE_NORMAL. And heads up: normalization is initially disabled. She starts off, okay? 😌


πŸ’… NOTES πŸ’…

The current normal can be updated at any time β€” she's flexible like that ✨. In particular, glNormal can be called between a call to glBegin and the corresponding call to glEnd. Yes, in the middle. Iconic behavior honestly πŸ‘‘


πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glGet with argument GL_CURRENT_NORMAL
  • glIsEnabled with argument GL_NORMALIZE
  • glIsEnabled with argument GL_RESCALE_NORMAL

🌈 SEE ALSO 🌈

glBegin(3G), glColor(3G), glIndex(3G), glNormalPointer(3G), glTexCoord(3G), glVertex(3G)


and that's the whole page, bestie πŸŽ€ that was GLNORMAL(3G) β€” yep, the 3G manual page signs off with the exact same name it walked in with, GLNORMAL(3G), so she's consistent, she's committed, she's literally the moment πŸ’œ mwah, go set some normals βœ¨πŸ¦‹

πŸ“¦ where this page comes from