setDepthFunc

HC Graphics Pen and Background Control setDepthFunc
setpen setFillTolerance

setDepthFunc num


sets the depth comparsion function of OpenGL. This can be useful when you want to overwrite drawn graphics, which might be nearer to the eye. See bounce3.lg for an example!

0=GL_NEVER Never passes.

1=GL_LESS Passes if the incoming z value is less than the stored z value. This is the default value.

2=GL_EQUAL Passes if the incoming z value is equal to the stored z value.

3=GL_LEQUAL Passes if the incoming z value is less than or equal to the stored z value.

4=GL_GREATER Passes if the incoming z value is greater than the stored z value.

5=GL_NOTEQUAL Passes if the incoming z value is not equal to the stored z value.

6=GL_GEQUAL Passes if the incoming z value is greater than or equal to the stored z value.

7=GL_ALWAYS Always passes.

Especially 3 and 7 are most useful.

Examples:

perspective
cs
setPC "red
setDepthFunc 7
Sphere 100
setDepthFunc 3
Sphere 100

Reference:

setpen setFillTolerance