Name
gl.NormalPointer -- define an array of normals
Synopsis
gl.NormalPointer(normalArray[, type])
Function
gl.NormalPointer() specifies an array of normals to use when rendering. normalArray can be either a one-dimensional table consisting of an arbitrary number of consecutive normals or a two-dimensional table consisting of an arbitrary number of subtables which contain a normal each. Every normal must contain x, y, and z coordinates specified as floating-point values. If normalArray is a one-dimensional table, you need to set the optional type argument to #GL_TRUE. If normalArray is a two-dimensional table, you can leave out the optional type argument or set it to #GL_FALSE.

If you pass Nil in normalArray, the normal array buffer will be freed but it won't be removed from OpenGL. You need to do this manually, e.g. by disabling the normal array or defining a new one.

To enable and disable the normal array, call gl.EnableClientState() and gl.DisableClientState() with the argument #GL_NORMAL_ARRAY. If enabled, the normal array is used when gl.DrawArrays(), gl.DrawElements(), or gl.ArrayElement() is called.

The normal array is initially disabled and isn't accessed when gl.DrawArrays(), gl.DrawElements(), or gl.ArrayElement() is called.

Execution of gl.NormalPointer() is not allowed between the execution of gl.Begin() and the corresponding execution of gl.End(), but an error may or may not be generated. If no error is generated, the operation is undefined.

gl.NormalPointer() is typically implemented on the client side.

Normal array parameters are client-side state and are therefore not saved or restored by gl.PushAttrib() and gl.PopAttrib(). Use gl.PushClientAttrib() and gl.PopClientAttrib() instead.

Please consult an OpenGL reference manual for more information.

Inputs
normalArray
one- or two-dimensional table containing normal values or Nil (see above)
type
optional: #GL_TRUE if the table in argument 1 is a one-dimensional table, else #GL_FALSE (defaults to #GL_FALSE)
Associated gets
gl.IsEnabled() with argument #GL_NORMAL_ARRAY

gl.Get() with argument #GL_NORMAL_ARRAY_TYPE

gl.Get() with argument #GL_NORMAL_ARRAY_STRIDE

gl.GetPointer() with argument #GL_NORMAL_ARRAY_POINTER


Show TOC