Problem with materials, normal vectors ?

I have been going through Nate Robins’s OpenGL tutors ( and am trying to use his .obj loader into another application.

I have a problem with the rendering of materials. When I use a very basic projection matrix, e.g :

    gluPerspective(60.0, (GLfloat)320/240, 1.0, 256.0);
    glTranslatef(0.0, 0.0, -5.0);  

The rendering is correct, the materials are correct, so are the axis.

But then, instead of this projection matrix, I am loading my own projection matrix (which is calculated by another tool, called ARToolKit).

With this matrix, the axis are in the same exact position, so is the model, but the materials are not rendered and the model appears totally black.

I have tried to move my light source around, but it had no effects. I also considered the idea that my normals could have been inverted by that new matrix, but in that case, I guess the model’s and axis’s orientation would have been affected too, right ?

Any one has a clue on where the problem could be ?


When do you position your lights and what is on the modelview matrix when you do this?

Light positions are transformed through the modelview matrix when you position them so the contents of the modelview is absolutely critical when you position lights.

My light (ambient) is left to the default position (0,0,1)

The MODELVIEW matrix is the following one :

-0.9485 -0.2967 0.1108 26.4590
-0.2821 0.9505 0.1302 67.0553
-0.1439 0.0923 -0.9853 -900.9683
0 0 0 1.0000

hey, this chapter on lighting in the redbook might clear thing up for you: