Specifies a normal vector for lighting calculations.
FORTRAN (libfgl.a)
void n3f(Float32 vector [3] )
SUBROUTINE N3F(vector) REAL vector (3)
The n3f subroutine specifies the normal vector to be used for lighting calculations.
The passed parameter (vector) becomes the current normal and is used when the lighting algorithm is rerun for all subsequent vertices. It is not necessary to respecify a normal if it is unchanged. For example, a single call to the n3f subroutine is sufficient for a flat-shaded polygon. However, the n3f subroutine must be called before the first vertex subroutine.
Lighting calculations assume that the specified normal is of unit length, as shown in the following equation:
x^{2} + y^{2} + z^{2} = 1.0
If the normal does not equal 1.0, or if no lighting model is active, the results are unpredictable.
When called with unequal arguments, the scale subroutine or any other nonorthonomial transformation causes a matrix skew that is corrected by renormalizing every normal. Lighting performance is reduced in this event.
The normal and n3f subroutines are the same in all respects.
The example C language program cylinder2.c calls the n3f subroutine between the bgnpolygon subroutine and the endpolygon subroutine to specify the normal vectors of a polygon.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
/usr/include/gl/gl.h | Contains C language constant and variable type definitions for GL. |
/usr/include/gl/fgl.h | Contains FORTRAN constant and variable type definitions for GL. |
Binding a new material, light, or lighting model definition with the lmbind subroutine.
Defining a new material, light, or lighting model with the lmdef subroutine.
Specifying a current normal vector for lighting calculations with the normal subroutine.
AIX Graphics Library Overview, Creating Lighting Effects, Drawing with Begin-End Style Subroutines, and Understanding the Hardware Used by GL.