Results 1 to 3 of 3

Thread: Selection limitations and questions

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    2

    Selection limitations and questions

    Im working on a project where we are displaying many rendered objects and we need to be able to select any one of them and return information on it. There are thousands of objects.

    When working with selection mode as described in the opengl programming guide, I only seem to be able to push 128 names onto the name stack. (Win9

    Is this a limitation of the name stack ? Or am I doing something wrong ? Is there a way around it ?

    The programming guide also describes "object selection using the back buffer" by assigning each object a unique color and simply checking what color youve selected. Is this the only way to implement selection of large numbers of objects ?

    Any input would be appreciated.

    Thanks
    ACS

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: Selection limitations and questions

    Hi !

    Yes, the name stack is limited...
    To know the limit, use glGetIntegerv with GL_NAME_STACK_DEPTH as parameter...

    The fact is that you do not have to push the names in the stack... Each time you draw a new object, you should use glLoadName !
    I believe the 'push' feature is useful when you want to be able to select sub-objects...

    Let's say you render a human body... It could be composed of Larm,Rarm,Lleg,Rleg,Head,Chest,...

    So you would start with :

    glLoadName(i_Human)
    glPushName(i_Larm)
    RenderLArm();
    glPopName();
    glPushName(i_Rarm)
    glRenderRarm();
    glPopName();
    ...

    If your objective is just to select amongst many objects that are on the same 'level', you just have to use glLoadName each time you draw a new object.

    So, you are limited for the sub-objects level only....

    I used to use the Color Buffer Selection trick but I discovered that using GL_SELECT mode is much more easier (and faster ?)...

    Hope this helps !

    Eric

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    2

    Re: Selection limitations and questions

    Yes that helps a lot, thanks !

    Is there any limit to the number of named things using glLoadName() ?

    ACS

Similar Threads

  1. Buffer selection questions
    By mbkelly in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 01-15-2019, 10:04 AM
  2. What are the limitations of FBO?
    By MrUNOwen in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 09-12-2011, 12:35 PM
  3. Selection Program Questions
    By cpsmusic in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-15-2006, 09:01 AM
  4. cubemap limitations?
    By Jan in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 08-07-2003, 04:10 PM
  5. ARB_vertex_program limitations
    By imported_titan in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 04-29-2003, 12:17 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