From: Stephen T. <ste...@sf...> - 2001-01-15 19:43:43
|
Hi Brian and all! There seems to be a bug in calculating normals of a sphere in src-glu/quadric.c. I cannot track down the exact problem or find a fix, but the following screenshots (one from mesa 3.4, one from sgi opengl of xfree86 4.0) obviously show something. Note the highlights of the spheres. http://www.sfu.ca/~stephent/tmp/mesa-sphere.gif http://www.sfu.ca/~stephent/tmp/sgi-sphere.gif The code is accanti.c from redbook. I can easily reproduce the bug with another simplified code. Normals of spheres at origin (no translation or rotation, quadric.c from redbook) *seem* to be okay. http://trant.sgi.com/opengl/examples/redbook/redbook.html Also, a (very) minor patch is to remove `TXTR_COORD' calls because of `!qobj->TextureFlag' condition in the branches. #define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y); Around line 404 in src-glu/quadric.c, if (!qobj->TextureFlag) { /* draw +Z end as a triangle fan */ glBegin(GL_TRIANGLE_FAN); glNormal3f(0.0, 0.0, 1.0); TXTR_COORD(0.5, 1.0); Around line 461 in src-glu/quadric.c, if (!qobj->TextureFlag) { /* draw -Z end as a triangle fan */ glBegin(GL_TRIANGLE_FAN); glNormal3f(0.0, 0.0, -1.0); TXTR_COORD(0.5, 0.0); Cheers, Stephen |