# glNormal

Definition: | include pGUI.e include opengl.e glNormal(atom nx, ny, nz) -- or -- glNormal3(atom {nx,ny,nz}) (actually declared as a single sequence parameter)
Description: | Deprecated, specifically not supported on WebGL. While still supported on desktop/Phix, these routines have been coloured illegal to indicate they cannot be handled by pwa/p2js. Sets the current normal vector. nx: the x-coordinate for the new current normal vector. ny: the y-coordinate for the new current normal vector. nz: the z-coordinate for the new current normal vector.
pwa/p2js: | Not supported.
Remarks | The current normal is set to the given coordinates whenever you call the glNormal function. Normals specified with glNormal need not have unit length. If normalization is enabled, then normals specified with glNormal are normalized after transformation. You can control normalization by using glEnable and glDisable with the argument GL_NORMALIZE. By default, normalization is disabled. You can update the current normal at any time. In particular, you can call glNormal() between a call to glBegin() and the corresponding call to glEnd(). The following functions retrieve information related to glNormal: glGet with argument GL_CURRENT_NORMAL glIsEnable with argument GL_NORMALIZE The glNormal function wraps the C glNormal3d routine. In fact, the opengl.e routine glNormal3 does too, despite bearing a superficial similarity to the C function glNormal3dv, however of course there is a significant difference between a sequence of length 3 and the raw address of the first double/float/int. See technicalia.
See Also: | glBegin, glColor, glEnd, int_to_bits, glTexCoord, glVertex DEV See also //glBegin //glColor //glEnd glIndex //glTexCoord //glVertex
Technicalia | In light of the fact that I found no examples where they were actually used, and to simplify the wrapper, and this documentation, I have removed (commented out) glNormal3b, glNormal3i, and glNormal3s. It would of course be trivial to ressurect them should they ever be needed. The original documentation said: Byte, short, or integer arguments are converted to floating-point format by using a linear mapping that maps the most positive representable integer value to 1.0, and the most negative representable integer value to -1.0. Since such values would not work with glNormal, which is a wrapper for glNormal3d, they are syntax coloured "Incompatible". Typically you would replace C glNormal3d and glNormal3f calls with glNormal, rather than glNormal3. The C functions glNormal3bv, glNormal3dv, glNormal3fv, glNormal3iv, and glNormal3sv are not currently wrapped, and are also coloured Incompatible. They would only be useful if there was some good reason why you already had your byte/double/float/integer/short triplet poked into some previously allocated memory.