Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Object Selection Question

  1. #1
    Intern Contributor
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    92

    Object Selection Question

    I have 72 triangles that act as 'selection' objects for the rubiks cube Im doing. The triangles are arranged on the cube, 12 to a side.
    Im working with the selection code in Chapter 13 in the 'OpenGL Programming Guide' and my question is this.

    Its possible for 2 or more of these selection triangles to overlap (as they are on opposite sides of the cube) and when the selection process occurs, does the computer automatically select the triangle closest to the camera? Or does it select all of them in that line of sight?

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    268

    Re: Object Selection Question

    When using selection it selects all objects in line of sight (even hidden objects). Each selection/hit has two z values, min and max, which you can use to determine which hit is closer. If you want the one on top (eg the one under the mouse) search the hits for the one with the smallest z value.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •