PDA

View Full Version : gl.Scale and glu.Sphere



devdept
07-11-2008, 07:02 AM
Hi All,

A very easy question:

Does the gl.Scale() func affect the normals size of the glu.Sphere() geometry?

In other words if I call gl.Scale(100,100,100) before the glu.Sphere(1,32,16) is lighting affected?

Thanks,

Alberto

dletozeun
07-11-2008, 07:22 AM
Yes and not, most implementations do automatically normals normalization when using a scale. You can use glEnable(GL_NORMALIZE); to make sure normals are normalized.

devdept
07-11-2008, 07:36 AM
I was looking for a yes or no answer...

Now I have the same doubts as before.

Is it enough to wrap the glu.Sphere() func as follows?


gl.Enable(GL_NORMALIZE);
glu.Sphere(1, 32, 16);
gl.Disable(GL_NORMALIZE);

Thanks.

Alberto

dletozeun
07-11-2008, 08:49 AM
Yes this is enough. What I mean is that some implementations do automatically normalization, some other not, and to force normlization you have to put glEnable(GL_NORMALIZE), that is all.

What is sure is that normals will be affected by the scale before the normalization stage.