Results 1 to 7 of 7

Thread: Depth

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2002
    Location
    Cairo , Egypt
    Posts
    7

    Depth

    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?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Depth

    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.

  3. #3
    Guest

    Re: Depth

    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.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Depth

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

  5. #5
    Guest

    Re: Depth

    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.

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2002
    Location
    Cairo , Egypt
    Posts
    7

    Re: Depth

    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).]

  7. #7
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Hawamdia, Giza, Egypt
    Posts
    17

    Re: Depth

    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.

Similar Threads

  1. Convert GL_UNSIGNED_INT_24_8 packed depth stencil to float depth
    By RealtimeSlave in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 11-05-2017, 07:37 AM
  2. Linear interpolation of depth value between front and back face depth values
    By RealtimeSlave in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-16-2016, 05:39 AM
  3. Stencil-op depth fail with depth testing disabled
    By AvCol in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-22-2011, 09:48 PM
  4. glDrawPixels / writing depth values with depth function GL_LESS
    By flo in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-26-2003, 02:49 AM
  5. why depth buffer save to image file can not display depth information
    By victorswan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-27-2001, 09:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean