Results 1 to 3 of 3

Thread: Picking problem

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    174

    Picking problem

    Hello guys.

    I'm trying to implement picking with glSelect, is is working but if I have picked one object like in the point that it intersect with another, I have problems, I think it will generate more than one hit, right ? Ok this is working :

    if(hits == 1) Perform_Selection();
    if(hits > 1) // Show a special message
    The message is being displayed, but now, how to control the ID of the next hit (next object) ??

    Hope I'm clear enough.
    Thank you for the moment.
    Best regards.
    Kurt

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    174

    Re: Picking problem

    ....

  3. #3
    Member Newbie
    Join Date
    Mar 2001
    Location
    New Zealand
    Posts
    39

    Re: Picking problem

    You need to move through the buffer specified in glSelectBuffer looking for the hit with the closest z value. I think Each hit fills up 4 elements in the buffer, the 2nd is the z value, and the 4th is the Name that you gave the object. Someone correct me if I'm wrong please.

    Hope that helps

Similar Threads

  1. Picking problem
    By steppo in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-10-2010, 06:49 AM
  2. picking problem
    By newasun in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-24-2005, 10:23 PM
  3. Picking problem
    By Jon723 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-23-2004, 07:08 PM
  4. PICKING PROBLEM
    By nstod in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-30-2002, 03:56 PM
  5. Problem with Picking
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-27-2002, 01:18 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