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 2 of 2

Thread: gluLookAt & depth culling

  1. #1
    Intern Newbie
    Join Date
    Nov 2013
    Posts
    43

    gluLookAt & depth culling

    I have a model 0.0 < z < 30.0. The default gluLookAt(0,-100,0, 0,0,0, 0,1,0); looks at the bottom of the model. If I rotate the model, the bottom of the model occludes anything above it.
    If I change to gluLookAt(0,100,0, 0,0,0, 0,1,0); the model disappears completely.
    ???

    Does it matter if gluLookAt is in glMatrixMode(GL_PROJECTION) or glMatrixMode(GL_MODEL)?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,322
    Quote Originally Posted by wmelgaard View Post
    I have a model 0.0 < z < 30.0. The default gluLookAt(0,-100,0, 0,0,0, 0,1,0); looks at the bottom of the model. If I rotate the model, the bottom of the model occludes anything above it.
    If I change to gluLookAt(0,100,0, 0,0,0, 0,1,0); the model disappears completely.
    ???
    glDisable( GL_CULL_FACE );
    glDisable( GL_DEPTH_TEST );

    And retry. Start debugging with that.

    Does it matter if gluLookAt is in glMatrixMode(GL_PROJECTION) or glMatrixMode(GL_MODEL)?
    Yes! First, there's no GL_MODEL (in the fixed-function pipeline); it's GL_MODELVIEW. And second, gluLookAt is a VIEWING transform so it goes into MODELVIEW. Check this out:

    * http://sjbaker.org/steve/omniv/projection_abuse.html

Posting Permissions

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