PDA

View Full Version : Non-uniform scaling of glucylinders in Linux



andres
10-14-2002, 12:35 PM
Hi. I'm developing an opengl application using Delphi 5.0 under windows and Kylix 3.0 under Linux.

I've found a strange problem problem when working in Linux, but I'm not sure whether it's an opengl issue, a kylix issue (or maybe I'm just doing something wrong).

Here is the problem: I have some display lists holding quadric objects (cylinders, spheres, etc.). When I call the display list corresponding to the cylinder, the lighting is wrong (too bright). I have to point out that I perform a rescaling using the glScaled function, but I enable the normals normalization before the scaling. When using other quadric objects, spheres for example, no problem is detected.

Here is the initialization code of the display list:

QTube:= gluNewQuadric;
gluQuadricNormals(QTube, GLU_SMOOTH);
gluQuadricTexture(QTube, GL_TRUE);

LTube:= glGenLists(1);
glNewList(LTube, GL_COMPILE);
gluCylinder(QTube, 1.0, 1.0, 1.0, 10, 1);
glEndList;

and here is the drawing code:

glEnable(GL_NORMALIZE);
glScaled(R, R, L);
glCallList(LTube);
glDisable(GL_NORMALIZE);

Note that the scaling is non-uniform (R <> L). When R = L the problem dissapears.
The problem also dissapears if I don't use the diplay list, this is, when I replace glCallList(LTube) by
gluCylinder(QTube, 1.0, 1.0, 1.0, 10, 1)

Thanks,
Andres

andres
10-15-2002, 05:48 AM
I found the cause of the problem: a bug in the mesa libraries that I was using in my system (version 4.0.1). After replacing them by version 4.0.3, the problem disappeared completely. Well, I think this doesn't count as an opengl problem, right?.
Next time, I'll go directly to the mesa website.

Andres