Results 1 to 3 of 3

Thread: from feedback buffer to gluUnProject

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    6

    from feedback buffer to gluUnProject

    from feedback buffer i got the xMax, xMin, yMax
    yMin,zMax, zMin values
    I want to use gluUnproject to turn them into 3D coordinate, but i failed!the result is not right!
    gluUnProject((GLdouble)m_xMin,
    (GLdouble)m_yMin,
    (GLdouble)m_zMax,
    dModelMatrix,
    dProjMatrix,
    iViewPort,
    &ObjectX,
    &ObjectY,
    &ObjectZ);
    ??????

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    6

    Re: from feedback buffer to gluUnProject

    i use the glutLookAt function in my program!
    is there any thing about it?

  3. #3
    Guest

    Re: from feedback buffer to gluUnProject

    that gluUnproject function will ham-string you if youre not careful. mainly, watch the screen-z (non-linear) and viewport-y (reversed):

    Code :
    GLint viewport[4];
    glGetIntegerv(GL_VIEWPORT, viewport);
     
    gluUnProject( 
        screen_x,              // screen x  
        viewport[3]-1-screen_y,// flip screen y 
        screen_z,              // between 0.0 and 1.0
        dModelMatrix,          // model matrix
        dProjMatrix,           // projection matrix
        viewport,              // viewport
        &ObjectX,              // world x
        &ObjectY,              // world y
        &ObjectZ               // world z
    );

Similar Threads

  1. feedback buffer problem
    By tobbyli in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-13-2014, 05:43 PM
  2. Depth Buffer vs gluUnProject
    By jtipton in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-05-2007, 08:32 AM
  3. from feedback buffer to gluUnProject
    By 122100 in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-08-2004, 10:23 AM
  4. Feedback Buffer
    By Balu in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-10-2003, 02:20 AM
  5. Feedback Buffer Problems
    By FATBUDDHA in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-27-2000, 04:15 AM

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