PDA

View Full Version : Depth



C17_H19_NO3_H2O
07-05-2002, 08:01 AM
I've a scene , it's Earth n' z Moon Orbiting , Ofcourse at sum point Moon will b Behind z Earth n' It can't b seen , but zis doesn't happen in My Scene , wen z Moon Becomes Behind Earth , I still can c z Moon , am not using Blending n' I use DepthFunc(GL_LEQUAL) , I tried (GL_LESS) but it's gives me z same problem , I tried 2 solve tht PRoblem By Drawing z Moon 1st n' zen z Earth , but z thing was reversed I get 2 c Earth even if am too close 2 z moon tht it can hide z earth , I use Glulookat , could b it causing all zese things
BTW , I don wanna use sorting Is zeres any other way of fixxing zis?

Bob
07-05-2002, 01:17 PM
Honestly, I have some problem reading you post cause of all those z, c, n', 2, b, and so on.

But after some struggling with it, I think you forgot to enable the depth test.

07-05-2002, 02:04 PM
Here's a tip: Learn to write/speak before you try and become a programmer. It really helps in 'z' end if you don't talk like a six year old.

Deiussum
07-05-2002, 04:55 PM
Originally posted by ULTIMATE MAXIMUM POWER:
Here's a tip: Learn to write/speak before you try and become a programmer. It really helps in 'z' end if you don't talk like a six year old.

Maybe English isn't his/her first language. There are people from a number of countries that post here.

Anyway, I would agree with Bob. It sounds like you didn't enabled depth testing. Also, if you are using Glut with Linux, make sure you use GLUT_DEPTH as one of the flags in the glutInitDisplay function.

07-05-2002, 06:07 PM
That's why I didn't say "learn to speak English."

I don't care what language you speak, if your main concern is looking cool by talking with letters and numbers like some AOL script kiddy, you shouldn't be worrying about how to get the depth buffer working properly, you should be more concerned with being able to convey your thoughts clearly.

C17_H19_NO3_H2O
07-05-2002, 10:58 PM
guyz , sorry , I didn't c a sign out there saying "no Slang Allowed"...
Maybe u should Consider putting it , So nobody will get Language-Related answer 2 his OpenGL Post ..
and yea , English isn't my first Language , Did U think If I posted this Question in Arabic <am Egyptian> I would get any answer?
Thnx Guyz , u really Helped , Thnx alot

Anywayz , Depth Test Is enabled , and i'm Working on Win98 ,and am not using GLUT, I
think it has nothing 2 do Depth Testing , I tried all the Depth Testing Modes (GL_LESS , GL_NEVER , GL_GREATER , GL_EQUAL , GL_LEQUAL , GL_GEQUAL) and ofcourse GL_ALWAYS ...

When I put the Moon-Rendering Code before the Earth's Code , I get a Reversed Results ,I can't see the Moon When IT's Behind the Earth (Like in real Life) , But I see the Earth through Moon (Like am using Blending)while am not using Blending..
Plz give me answers for the Opengl Question , Leave my Language alone , this is OPENGL.ORG OK...
If U can't get what am trying to say ,just forget about the Post..

Thnx




[This message has been edited by C17_H19_NO3_H2O (edited 07-06-2002).]

Mohamed Hassan
07-06-2002, 12:32 AM
Hello,
First of all if you are using gluLookAt you should adjust your parameters carefuly, then use DepthFunc(GL_LESS) and glClearDepth(1). After that and before rendering your moons you should clear the depth_buffer_bit and I hope that every thing will go smooth.