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: How do I obtain the projection matrix and the depth value?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2000
    Posts
    6

    How do I obtain the projection matrix and the depth value?

    I want to know the projection matrix and the depth value in each pixel.

    And I will solve the 3D coordinate value in the real axis.

    But I don't know the function that can return the projection matrix

    and the depth value.

    Thanks in advance...

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Augsburg, Germany
    Posts
    334

    Re: How do I obtain the projection matrix and the depth value?

    Code :
    GLdouble projMatrix[16];
     
    glGetDoublev(GL_PROJECTION_MATRIX,projMatrix);
    returns you the projection matrix.

    Code :
    glFloat pixels;
     
    glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&pixels);
    gives you the z value at a specific 2D point on screen.

    Kilam.

Posting Permissions

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