HP j6700 OpenGL Implementation Guide for HP-UX 11.x - Page 61

rescaling normals, GL_RESCALE_NORMAL_EXT

Page 61 highlights

programming hints OpenGL performance hints • Single buffered applications • Alpha planes • Depth 8 visuals • Stereo • Gradient backgrounds rescaling normals When normal rescaling is enabled, a new operation is added to the transformation of the normal vector into eye coordinates. The normal vector is rescaled after it is multiplied by the inverse modelview matrix and before it is normalized. The rescale factor is chosen so that in many cases, normal vectors with unit length in object coordinates will not need to be normalized as they are transformed into eye coordinates. As of Release 1.05 of HP's implementation of OpenGL 1.1, the GL_RESCALE_NORMAL_EXT token is supported. It is accepted by the parameter of glEnable, glDisable, and glIsEnabled, and by the parameter of glGetBooleanv, glGetIntegerv, glGetFloatv, and glGetDoublev. Normals that have unit length when sent to the GL, have their length changed by the inverse of the scaling factor after transformation by the model-view inverse matrix when the model-view matrix represents a uniform scale. If rescaling is enabled, then normals specified with the Normal command are rescaled after transformation by the Modelview Inverse. Normals sent to the GL may or may not have unit length. In addition, the length of the normals after transformation might be altered due to transformation by the model-view inverse matrix. If normalization is enabled, then normals specified with the glNormal3 command are normalized after transformation by the model-view inverse matrix and after rescaling if rescaling is enabled. Normalization and rescaling are controlled with glEnable and glDisable with the target equal to NORMALIZE or RESCALE_NORMAL. This requires two bits of state. The initial state is for normals not to be normalized or rescaled. Chapter 5 59

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

programming hints
OpenGL performance hints
Chapter 5
59
Single buffered applications
Alpha planes
Depth 8 visuals
Stereo
Gradient backgrounds
rescaling normals
When normal rescaling is enabled, a new operation is added to the
transformation of the normal vector into eye coordinates. The normal
vector is rescaled after it is multiplied by the inverse modelview matrix
and before it is normalized.
The rescale factor is chosen so that in many cases, normal vectors with
unit length in object coordinates will not need to be normalized as they
are transformed into eye coordinates.
As of Release 1.05 of HP’s implementation of OpenGL 1.1, the
GL_RESCALE_NORMAL_EXT
token is supported. It is accepted by the
<cap>
parameter of
glEnable
,
glDisable
, and
glIsEnabled
, and by the
<pname>
parameter of
glGetBooleanv
,
glGetIntegerv
,
glGetFloatv
,
and
glGetDoublev
.
Normals that have unit length when sent to the GL, have their length
changed by the inverse of the scaling factor after transformation by the
model-view inverse matrix when the model-view matrix represents a
uniform scale. If rescaling is enabled, then normals specified with the
Normal command are rescaled after transformation by the Modelview
Inverse.
Normals sent to the GL may or may not have unit length. In addition,
the length of the normals after transformation might be altered due to
transformation by the model-view inverse matrix. If normalization is
enabled, then normals specified with the
glNormal3
command are
normalized after transformation by the model-view inverse matrix and
after rescaling if rescaling is enabled. Normalization and rescaling are
controlled with
glEnable
and
glDisable
with the target equal to
NORMALIZE
or
RESCALE_NORMAL
. This requires two bits of state. The
initial state is for normals not to be normalized or rescaled.