Results 1 to 2 of 2

Thread: Problems picking the right object

  1. #1
    Guest

    Problems picking the right object

    I try to pick objects using the glSelectBuffer and the glPickMatrix.
    I get the correct number of hits using glRenderMode(GL_RENDER).
    Then I try to get from the buffer the object name that is closer to the camera.
    but I cannot understand the way data is passed into the buffer.
    e.g. once I click on three objects I get somthing like
    1,mindist,maxdist,1,2,mindist,maxdist,1,2,3,mindis t,maxdist,1,2,3,....
    and another time something like
    1,mindist,maxdist,1,3,mindist,maxdist,1,2,3,4,mind ist,maxdist,1,2,3,4,...

    How should I read the buffer?
    Is there another ,easier or faster, way to get the selected object name?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2000
    Location
    Donetsk,Ukraine
    Posts
    118

    Re: Problems picking the right object

    Maybe it's due to you pushing names.
    There is no need to do this.
    Push name only once at start, then just glLoadName.

    Randy

Similar Threads

  1. What is the best method for object picking?
    By gmseed in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-19-2012, 03:29 PM
  2. picking object
    By newasun in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-24-2005, 01:21 AM
  3. Object Picking
    By Montoya in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-22-2003, 12:12 AM
  4. OpenGL and MFC: picking object
    By ChrisT in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 05-06-2001, 04:39 AM
  5. Object picking...
    By Spotaszn in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-11-2000, 03:11 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