I don’t know if someone has already encountered this problem: I have a big (approx 85 units high) human model which should be lit, while I move the camera around it. The model is loaded from a 3dsmax ASE file with its mapping coords, normals, etc. (y and z flipped of course)…
I created a light source with the following params:
glLightfv(ID, GL_DIFFUSE, rgba);//rgba is 4,4,2
glLightfv(ID, GL_POSITION, pos);//position is set correctly to the coords I want (10,100,50,1)
lighting is enabled, glLight0 too
I also set the ambient value with another light (glLight1), but I don’t care about it right now.
So, as you can see, I have a model and a positional light. The problem is, when I try to lit the model, it seems, as the light wouldn’t be positional. Imagine a line going from the middle of the screen through the light source and hiting the model. Where it is hit, it is lit, but it doesn’t look like (even a little bit), as this light would work as a normal omni light. It doesn’t emit light to all directions.
As my code is too big to fit it here, i will just write the concept of displaying things:
- setting perspective and glulookat (moving cam)
- glMatrixMode( GL_MODELVIEW );
- setting color and position of light
- glTranslate and rotate
- displaying mesh with glCallList
Why doesn’t this light work as a real omni one? Does it have anything to do with the normals stored in the ASE file?