Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: bird flying between mountain

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    2

    bird flying between mountain

    hello
    i am writing a game
    i wrote a scene (3 wall with texture of sky ,1 wall with texture of grass, 2 mountain with glutSolidCone )
    and a bird is flying in the scene,
    ----------------------------------------
    but in the display() if i write :

    //draw scene
    //birdflying()

    bird flies in front of mountain

    but if i write:

    //birdflying()
    //draw scene

    bird flies behind of mountain

    -------------------------------------------
    but i want that bird flies behind and in front of mountain and ofcourse between them,what's wrong? what should i do?

    thanks in advance

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    989
    You probably didn't enable depth test or you don't have a depth buffer.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    2
    Quote Originally Posted by aqnuep View Post
    You probably didn't enable depth test or you don't have a depth buffer.
    yes i forgot it
    but when i write glEnable(GL_DEPTH_TEST); in the init and run my program ,it shows nothing just black window. now what should i do?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •