PDA

View Full Version : Depth Problem



djavan
02-26-2003, 08:26 AM
Hi everyone

I am drawing three groups of objects (lines, triangles and rectangles, while the latter two being solid with their edge-lines drawn too) each in a glPushMatrix,glPopMatrix block and then looking at the entire image from different view-points with gluLookAt.

As far as the drawing is concerned, everything works fine but somehow the "hide/show" property of the objects is not correct. That is, since the rectangles and triangles are solid, I expect them to cover up (i.e. hide) whatever that falls behind them based on my view-point. But they are visible like hell!?!?!

For your added information I have the following commands in my StartUpRC routine (which is only called once at the beginning):

glDisable glcDepthTest
glEnable glcCullFace
glShadeModel smSmooth
glClearColor 1#, 1#, 1#, 1#

I appreciate your help very much.

jwatte
02-26-2003, 09:53 AM
1) go to the beginner's forum (or, if you prefer, download and read the spec, or buy a book such as the red and blue books)

2) post/look up "glDepthFunc" and GL_DEPTH_TEST

djavan
02-26-2003, 05:14 PM
I'm sorry if my trivial question has insulted your expertise.

Honestly, I've read all the parts related to the DepthTest and DepthFunc and also tried setting different comparison values (via glDepthFunc) but still either my "space" is inside-out (with GL_LESS) or nothing is shown (with GL_GREATER).

I promise from bottom of my heart that if you help me with this, I would never post anything on this forum!

DopeFish
02-26-2003, 05:51 PM
I dont see the post as an insult to anyones "expertise", however its definately in the wrong forum.

rgpc
02-26-2003, 10:16 PM
Originally posted by djavan:
Honestly, I've read all the parts related to the DepthTest and DepthFunc and also tried setting different comparison values (via glDepthFunc) but still either my "space" is inside-out (with GL_LESS) or nothing is shown (with GL_GREATER).

a). I agree with John. This is a beginner question which, quite frankly, you have not put very well.

b). You are not insulting our expertise, you are annoying the crap out of use by making an innappropriate post. This occurs FAR too often and recently has run like a plague through this forum. Personally I would like to volunteer to be a moderator for this list so I can delete these types of posts.

c}. You've read the spec etc. on Depth Testing but do you understand it? I think not. The 4 lines of code you posted are largely irrelevant and I'd ask you some questions that would provide information that's relevant but we don't want beginner questions in the advanced forum (It's Advanced Opengl Coding - Not Advanced questions according to your current knowledge)

Ysaneya
02-27-2003, 03:14 AM
The 4 lines of code you posted are largely irrelevant


I don't agree, seing that his first line of code is glDisable(GL_DEPTH_TEST) and he's complaining about not having the depth test.. huh..

Y.

djavan
02-27-2003, 04:51 AM
Thank you all and again my apologies for wasting your time. Just wanted to let you know that I got my problem fixed with the help of some kind helpers via posting it in the beginner's forum and it wasn't just an straight forward solution.

As I promised, I won't show up here ever and never!!

rgpc
02-27-2003, 08:12 PM
Originally posted by Ysaneya:
I don't agree, seing that his first line of code is glDisable(GL_DEPTH_TEST) and he's complaining about not having the depth test.. huh..

Y.

Hmm good point - missed that one (read it from the bottom up and saw glEnable instead of glDisable...)