a hidden line showed in a dashed way,please help!

i want to draw a plane in front of line .the line looks like this: the exposed part is drawn in solid,and the hidden part is in dashed ,
is there a way to solve this problem ?please help me !thank you very much!

Draw the plane first, then the line twice. The first time with glDepthFunc(GL_LESS) and no stipple, the second time with glDepthFunc(GL_GREATER) and some stipple pattern.

ok,i get it.thank you very much! :slight_smile: