glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE

Qn(1)after setting the following to be true —

glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE)

a)where does the viewing point gets set?

b)If I change gluLookAt() to glLookAt(1,1,1, 0,0,-1, 0,1,0),

will the viewing point in a) be automatically changed to (1,1,1)

    or 

it will be same as (0,0,0) immaterial of gluLookAt position???

a) google http://www.manpagez.com/man/3/glLightModeli/

Are this function really useful? :eek:

b) answer b) I don’t understand your question. What I am sure is this has nothing to do with question a) :slight_smile:

The viewing point is always (0, 0, 0) in the modelview space.

In the fixed function pipe, lighting always occurs in eye space in the vertex shader.

I think what local viewer boils down to is whether the eye vector (vector from point to be lit to the eyepoint) is regarded to be the eye-space Z axis vector (local viewer = FALSE) or the eye vector is dynamically recomputed per vertex to point toward the eye-space origin (the eyepoint). So to answer your question, (1,1,1). However, if local viewer was false, the eye vector would always be your look vector.