kingcu
11-13-2005, 06:52 PM
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 using JOGL. And here are what I did:
1. Enable depth test;
2. Enable lighting;
3. Enable light0;
4. Set light properties (ambient, etc);
5. Set the material properties;
6. 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
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 using JOGL. And here are what I did:
1. Enable depth test;
2. Enable lighting;
3. Enable light0;
4. Set light properties (ambient, etc);
5. Set the material properties;
6. 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