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: RubberBand Selections

  1. #1
    Intern Contributor
    Join Date
    Apr 2004
    Location
    Bangalore India
    Posts
    64

    RubberBand Selections

    Hi Folks,

    I have got a polygon mesh geometry with vertices as cubes. I was able to pick any particular vertex and translate the cube.
    I need to implement rubber band selections on it now. How to set the selection process to indentify the cubes falling under my mouse dragged rubberband.

    Thanks
    kumar.k
    Regards

    K.Kumar

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: RubberBand Selections

    As you know the selection process renders to a frustum. Right now you will (if using selection buffer rendering), be specifying a small frustum around the mouse position based on the window frustum and interpolation +/- some small selection size.

    To extend this to rubber banding what you must do is adjust the selection rendering frustum to encompass the extents of the mouse rubber band drag. So, the mouse press defines one corner of the frustum which you can calculate through interpolation. Subsequent mouse moves update the opposite frustum corner, leaving you with a frustum you can render the scene to and fill the selection buffer with hits. Watch out for zero width & height frusta.

    You can render to the selection buffer each mouse move and render the rubber band also, how you update the window is up to you, a save & restore of the image would work, you could also render highlighted vertices as they are selected.

    The least work would be to perform the selection render only on a mouse release which defines the opposite frustum corner, that's not as cool though.

  3. #3
    Intern Contributor
    Join Date
    Apr 2004
    Location
    Bangalore India
    Posts
    64

    Re: RubberBand Selections

    Thank you Dobrie, I think i can do this one now.

    I have got one more small question which i have posted as "problems with arbitary rotations " in math and and algorithms group. But no one seems to reply me .....

    Can you have a look at it and tell me how to proceed.

    Thanks Any way for you valuble advise

    kumar.k
    Regards

    K.Kumar

Posting Permissions

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