Ok i was trying this out and i came up with some wierd results. I tried this by modifying the nVidia LitQuad example. Now what i did was load the modelview matrix in a float array called m. And in the part that loads the view vector into constant register 8 is where i put the m[2],m[6],m[10]. Now i also changed the light direction to 0,0,-1 instead of what they had which made the light point at the quad at an agngle to the left. The function that put that into reg 8 looked like this:
glProgramParameter4fNV( GL_VERTEX_PROGRAM_NV, 8, m[2], m[6], m[10], 1.0f );
Ok when i put those values from the modelview matrix i extracted when the quad was about pointing about 45 degrees from the right and left side of the origin (which was the center of the quad) it would act wierd. What happened was when the quad was facing to the right at about 45 degrees, the light would just ‘pop’ on. It wouldnt gradually come on like its supposed to. Then the light would be ok untill the quad was facing to the left at about 45 degrees, then it would just ‘pop’ off. Again instead of gradually going dim to black.
BUT, when i did this:
glProgramParameter4fNV( GL_VERTEX_PROGRAM_NV, 8, 0.0f, 0.0f, m[10], 1.0f );
It worked like its supposed to. The light didnt pop on and off and it graudually came on and off. Now when i did this:
glProgramParameter4fNV( GL_VERTEX_PROGRAM_NV, 8, m[8], m[9], m[10], 1.0f );
It worked fine. So what i want to know is, why did this happen when i used m[2],m[6],m[10]. And why did it work fine when i put in m[8],m[9],m10]. What is in m[2],m[6] AND m[8],m[9]?
-SirKnight