the flash problem of Antialiased line in Enable Depth Test 3D Scene!

hello, everyone.My nut is when I wanna draw some 3D lines in a 3D filled surface,and enable depth test together by using code glEnable(GL_DEPTH_TEST).Then I found the lines always flashed when I rotated the total subject(the surface and the lines).In addition, I used Antialiased lines in my coding.
How can I solve this flashed problem??

use glPolygonOffset() on the lines. i think there is a mode to do this for GL_LINES primitives. it will offset the depth values of the lines so you dont get the Z-fighting you are seeing (the flashing lines). the probelm is that depth values for the lines are almost the same as the filled surface, numerical precision errors are causing the relationship to change when you rotate. see the red book (openGL programming guide) for info.

[This message has been edited by vshader (edited 09-19-2002).]

You can’t use glPolygonOffset() on the lines, see :
http://www.opengl.org/developers/faqs/technical/polygonoffset.htm#0040

But you can use glPolygonOffset() to push back the polygons where your lines must be drawn.

I’d correct the problem by apply glPolygonOffset() in my surface codes, So it OK!
Thank you very much!