[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glNormal Subroutine

Purpose

Sets the current normal vector.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glNormal3b(GLbyte XCoordinate, 
   GLbyte YCoordinate,
   GLbyte ZCoordinate)
void glNormal3d(GLdouble XCoordinate, 
   GLdouble YCoordinate,
   GLdouble ZCoordinate)
void glNormal3f(GLfloat XCoordinate, 
   GLfloat YCoordinate,
   GLfloat ZCoordinate)
void glNormal3i(GLint XCoordinate, 
   GLint YCoordinate,
   GLint ZCoordinate)
void glNormal3s(GLshort XCoordinate, 
   GLshort YCoordinate,
   GLshort ZCoordinate)
void glNormal3bv(const GLbyte *ArrayPointer)
void glNormal3dv(const GLdouble *ArrayPointer)
void glNormal3fv(const GLfloat *ArrayPointer)
void glNormal3iv(const GLint *ArrayPointer)
void glNormal3sv(const GLshort *ArrayPointer)

Parameters

glNormal3b, glNormal3d, glNormal3f, glNormal3i or glNormal3s

XCoordinate, YCoordinate, and ZCoordinate
                          Specify the x, y, and z coordinates of the new current normal. The initial value of the current normal is (0,0,1).

glNormal3dv, glNormal3fv, glNormal3iv or glNormal3sv

ArrayPointer Specifies a pointer to an array of three elements: the x, y, and z coordinates of the new current normal.

Description

The current normal is set to the given coordinates whenever the glNormal subroutine is issued. Byte, short, or integer arguments are converted to floating-point format 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.

Normals specified with glNormal need not have unit length. If normalization is enabled, then normals specified with glNormal are normalized after transformation. Normalization is controlled using the glEnable and glDisable subroutines with the GL_NORMALIZE argument. By default, normalization is disabled.

Notes

The current normal can be updated at any time. Specifically, glNormal can be called between a call to the glBegin subroutine and the corresponding call to the glEnd subroutine.

Since input normals are transformed before being used for lighting, any non-orthonormal modeling matrix will produce indeterminate results unless normalization is enabled. See the glScale subroutine.

Associated Gets

Associated gets for the glNormal subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_CURRENT_NORMAL

glIsEnabled with argument GL_NORMALIZE.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin subroutine, glColor subroutine, glDisable subroutine, glEnable subroutine, glEnd subroutine, glIndex subroutine, glNormalPointer subroutine, glNormalPointerEXT subroutine, glScale subroutine, glTexCoord subroutine, glVertex subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]