Changing the hue of a color may be accomplished by loading a rotation
about the gray vector (1, 1, 1). This operation may be performed in
one step using the `glRotate()` command. The matrix may also be
constructed via the following steps [39]:

- tex2html_nowrap 49.
- Load the identity matrix (
`glLoadIdentity()`). - tex2html_nowrap 50.
- Rotate such that the gray vector maps onto the
*z*axis using the`glRotate()`command. - tex2html_nowrap 51.
- Rotate about the
*z*axis to adjust the hue (`glRotate<degrees>, 0, 0, 1(<degrees>, 0, 0, 1)`). - tex2html_nowrap 52.
- Rotate the gray vector back into position.

you realize the plane of constant luminance

Therefore, the vector (

- tex2html_nowrap 53.
- Load the identity matrix.
- tex2html_nowrap 54.
- Apply a rotation matrix
*M*such that the gray vector (1, 1, 1) maps onto the positive*z*axis. - tex2html_nowrap 55.
- Compute
(
*R*_{w}',*G*_{w}',*B*_{w}') =*M*(*R*_{w},*G*_{w},*B*_{w}). Apply a skew transform which maps (*R*_{w}',*G*_{w}',*B*_{w}') to (0, 0,*B*_{w}'). This matrix is:

- tex2html_nowrap 56.
- Rotate about the
*z*axis to adjust the hue. - tex2html_nowrap 57.
- Apply the inverse of the shear matrix.
- tex2html_nowrap 58.
- Apply the inverse of the rotation matrix.