Hi,
I know this is weird. I have some problem with the direction of the normal. I know it should be pointing outward; however, when I try to disply a 3D unit cube made of 6 polygons, for each polygon, I have to set the normal to point toward the inside of the cube to get the proper color. Otherwise, if I use the regular outward-pointing normals, everything is black. I am assuming the x-y-z coordinate is a right-hand coordinate system, with positive x point to the right hand side of the screen, positive y point upward and positive z pointing out the screen; also, I am specifying the vertices in a counter clockwise order if looking from the outside.
I am using JOGL. And here are what I did:
- Enable depth test;
- Enable lighting;
- Enable light0;
- Set light properties (ambient, etc);
- Set the material properties;
- Enable GL_NORMALIZE;
I didn’t touch either the projection matrix or the modalview matrix.
Any one has any idea how this could be?
Thank you,
wt