I want to draw a surface comprising triangular faces. Each point forming the triangular faces has different colors arranged. The codes are as follows.
However, it looks that the surface displayed is not SMOOTH with many sawtooths (color sawtooths).
Originally posted by Jackis:
[b]The decision for your problem is
glShadeModel(GL_SMOOTH);
That thing you’ve done actually does polygon edge smoothing, it doesn’t affect color interpolations.[/b]
Thank you first.
But I have used glShadeModel(GL_SMOOTH). The colors, especially at the edges of different colors, are still not SMOOTH. There are many color sawtooths.
It is very unlikely that this is caused by a driver/implementation bug.
When I asked “how” I meant “in which order”.
To debug this you may set all vertices colors the same, then a keypress change color on a element in
Color[i][j] array. Then have others key to change i,j, and see how the color changes.
And try displaying in wireframe, to better spot how the triangles are drawn.
You have a problem displaying a smooth color gradient - your graphics setting is probably for 256 or 65535 colors, which can cause such effects. Try changing to 24- or 32-bit depth.