Results 1 to 2 of 2

Thread: Urgent : gluPickMatrix with VC++

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000

    Urgent : gluPickMatrix with VC++

    I need some help because I have an urgent project to do and I have a problem with the picking. In fact, these 3 lines heve been given to me by experienced users but they used glut and not VC++ :
    GLint viewport [4];
    glGetIntegerv (GL_VIEWPORT, viewport);
    gluPickMatrix (xmouse, viewport [3] - ymouse, 1., 1., viewport);
    i think it's a window coordinate problem.

    I hope you can help me.


    PS: sorry for my bad english but i'm french

  2. #2
    Member Newbie
    Join Date
    Mar 2000

    Re: Urgent : gluPickMatrix with VC++

    Your code is correct, I think that it's more likely that your problem lies in the code before or after this statement.

    Just double check that you've carried out operations in this order:

    1. Call glSelectBuffer
    2. Call glRenderMode(GL_SELECT)
    3. Select the projection matrix
    4. Load identity
    5. Call gluPickMatrix (as in your question)
    6. Call gluPerspective (if you're using perspective)
    7. Select the modelview matrix
    8. Load identity
    9. Clear depth and colour buffers
    10. Draw scene pusing and popping names where appropriate
    11. Call glRenderMode(GL_RENDER)
    12. Read through your selection buffer, to find the lowest z-value.

    (this last part can be slightly awquard, unless you've made sure that there's only one name on the stack at the time)

    I might have missed out a step or two..

    Hope this helps.

Similar Threads

  1. gluPickMatrix
    By devdept in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 07-21-2007, 03:06 PM
  2. gluPickMatrix
    By yaba in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 08-22-2002, 10:53 PM
  3. gluPickMatrix
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-23-2001, 11:30 PM
  4. Urgent : gluPickMatrix with Visual C++ 6.0
    By ceuseb in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-17-2000, 07:01 AM
  5. gluPickMatrix
    By PeterK in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-14-2000, 02:28 PM

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