View Full Version : GL_SMOOTH & normals issues

03-11-2011, 05:49 AM
I have been looking all over the web for a way to use GL_Smooth in my project and I have found out that it has something to do with vertex normals,
but i wasnt able to make it work for me, can someone in here help me or direct me please to some guide that will tell me how to use them?
My drawing function looks like this:



x = radius * cos(rotX) * cos(rotY);
y = radius * sin(rotX);
z = -radius * cos(rotX)* sin(rotY);


glShadeModel( GL_SMOOTH );

glutSolidSphere(.5, 20, 20);


when everything else that i need to do works good(I needed to create a 3d "Flythrough mode" using the arrow keys which worked, the the only problem i have now is making it use the GL_SMOOTH Shading feature)

Thanks a lot (=

03-11-2011, 06:14 AM
Didn't get the problem. What your code does is to set up the camera location, this is not to do with vertex normals of your model. What exactly you are getting when GL_SMOOTH is enabled?

I think you should know that GL_SMOOTH requires a per-vertex normal to work properly, maybe that's is the problem.

take a look at glNormal (http://www.khronos.org/opengles/documentation/opengles1_0/html/glNormal.html)

03-11-2011, 10:18 AM
thanks for the quick answer,
no i wasnt able to do that right yet
am i suppose to calculate the normal for each vertex or will it be enough to write:

glVertex3f(curr.x, curr.y, curr.z);
beacuse if it is so simple than i have encountered a problem with the lighting now - it doesnt look as it should have been( i need to make a "Diffuse reflection" light model)
and again thanks you really helped me getting in the right direction