Smooth in open GL
I am trying to have a "smooth" effect on a object created polygon by polygon. I have glShadeModel(GL_SMOOTH) but it seems that I need to do something else to have a smooth looking surface.
NEED HELP
Thanks
Phil.
You need to get the normals for every surface before OpenGL can take the polys and make them smooth.
------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games (I had to make one up, to fit in with the rest of you )
Project: Writing tutorials and code for my OpenGL Game Programming series
OpenGL Game Programming Tutorials
------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games (I had to make one up, to fit in with the rest of you )
Project: Writing tutorials and code for my OpenGL Game Programming series
OpenGL Game Programming Tutorials
If you get 1 normal per surface on your mesh you''ll get a flat shading which isn''t exactly "smooth". If you get 1 normal per vertex on your mesh OpenGL will gouraud shade it making the mesh look all pretty and "smooth".
GL_SMOOTH = Gouraud shading.
It''s up to you to give the code the good value to get the desired effect.
-* So many things to do, so little time to spend. *-
It''s up to you to give the code the good value to get the desired effect.
-* So many things to do, so little time to spend. *-
If you use polygon normals, to calculate vertex normals loop through all vertices and calc the average normal vector for all polys the vertex is used in.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement