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 3 of 3

Thread: selection mode strange problem

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    selection mode strange problem

    Hi guys:
    I had a problem when using selection mode to pick glutSolidSpheres in the scene.
    I have 43 spheres, with each name as 1-43.
    The problem is, if I dont click on the spheres, the selection buffer indicates I have picked the last spheres, that is, selectBuff[3]=43, and the hit value given by glRenderMode(GL_RENDER) call is 1.

    If I click on, for example, sphere with name=33, the glRenderMode(GL_RENDER) return value is 2. and the selection buffer indicates that I have clicked both sphere 43 and sphere 33.

    I am not able to provide the code because it is in my work place. I will be able to provide the code after this weekend.
    Right now I just want to ask you guys that, what kind of mistake might cause this kind of problem?

  2. #2
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    947

    Re: selection mode strange problem

    If you get ID of the last sphere, and you didn't click on it, that indicates that you probably have problem with setting frustum parameters. It must be set exactly the same way as in the case of rendering.

    Having multiple records in the selection buffers is regular case. All objects that intersect picking frustum are included. You have to find the nearest from the minZ parameter.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: selection mode strange problem

    Thanks for the reply.
    After calling the last glloadname and the last sphere, my drawing function also draws objects which i dont want to pick. Is that possible that opengl thinks the last name i loaded is name for both the last sphere and all other objects, which were drawn after drawing the last sphere?

Posting Permissions

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