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: Problem with Rotating cube....

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2003
    Location
    Redmond, WA, USA
    Posts
    2

    Problem with Rotating cube....

    I'm obviously a beginner in OpenGL....

    I've made a cube in OpenGL, and then I made it spin. It works fine, except it looks like you can only see the inside of the cube. There are somefaces that are always redrawn, and some faces that disappear if there is a face in front of it. Is there an OpenGL command to always show the faces nearest you? Is there something else that I'm not doing? Any help would be much appreciated.

    -Michael S. Rehse

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,096

    Re: Problem with Rotating cube....

    Without seening your code can not say what is happing...

    This website: nehe.gamedev.net has good openGL tutors, and one is on a spinning cube. It will give you help on writting openGL programs.


    Originally posted by rehseboy:
    I'm obviously a beginner in OpenGL....

    I've made a cube in OpenGL, and then I made it spin. It works fine, except it looks like you can only see the inside of the cube. There are somefaces that are always redrawn, and some faces that disappear if there is a face in front of it. Is there an OpenGL command to always show the faces nearest you? Is there something else that I'm not doing? Any help would be much appreciated.

    -Michael S. Rehse

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Poland
    Posts
    197

    Re: Problem with Rotating cube....

    I think You didn't enable depth testing.
    Put this line at the beginning of rendering code or in some initialization funtcion:

    glEnable(GL_DEPTH_TEST);

    that should help I think

    cheers,
    yaro

Posting Permissions

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