Results 1 to 4 of 4

Thread: picking problem

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    San Francisco, CA, USA
    Posts
    22

    picking problem

    The red book didnt mention much about picking when an 2 objects are on top of the other one (z axis). How do I achieve picking the highest (closest to me) object?

  2. #2
    Member Contributor
    Join Date
    Mar 2000
    Location
    PA, USA
    Posts
    70

    Re: picking problem

    If you're using the GL selection mode, the hit records include min and max z values for each hit. You can use these to determine the closest to the camera.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    San Francisco, CA, USA
    Posts
    22

    Re: picking problem

    If I use assign names to each object and each object overlap each other on the z axis, will the buffer have information on all the names of the object so I can deside on which object to pick, OR does it only give me the number of hits and max/min z values?

  4. #4
    Member Contributor
    Join Date
    Mar 2000
    Location
    PA, USA
    Posts
    70

    Re: picking problem

    The gl selection mode is a "shoot-through" selection. Therefore, everything that intersects the picking region will register a hit.

    One thing to remember is that each hit record will have as part of it the contents of the name stack at the time of the hit. One way to simplify the hit record is to ensure that you only push one name onto the name stack and use glLoadName for subsequent names. This will simplify the hit record processing (however, this may not be acceptable for every application).

    Hopefully this 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