Results 1 to 4 of 4

Thread: Selection with mouse drag

  1. #1
    Guest

    Selection with mouse drag

    hi!

    I am a opengl newbie and i like to be able to select a range of vertices using mouse drag to draw a rectangle bounding the vertices.

    Currently, i am using selection to select individual vertices and it is working fine.

    thanks for looking into this post and thanks again in advance for the help rendered.

    regards
    patric

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    173

    Re: Selection with mouse drag

    I would also like to do this. I had some dificulty selecting vertices though. I had to change these vertices to crosses formed with lines and then it worked fine. If you find out how do this I would apreciate if you could inform me about this. Thanks.

    P.S. Maybe you should post this on the advanced forum.
    Billy

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Augsburg, Germany
    Posts
    334

    Re: Selection with mouse drag

    If you want to draw a rectangle on the screen and get all vertices inside this rectangle, do the following:
    You got the coordinates x1/y1 and x2/y2 of the rectangle selection. Then you do a gluProject for each 3D-vertex you want to check. The result is the 2D-point on screen for each vertex. Then simply check if it's inside the rectangle.


    Kilam.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    State College, PA
    Posts
    186

    Re: Selection with mouse drag

    Is it possible to do this with the select buffer by taking the coordinates at the center of the box and creating a picking matrix for the whole rectangle instead of just a few pixels around the cursor?

    Chris

Similar Threads

  1. Drag object based on mouse selection
    By gwartney in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-15-2016, 10:15 PM
  2. 3D Mouse Drag
    By bobGL in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-27-2008, 12:00 PM
  3. How to drag a 2D selection rectangle over 3D view?
    By Duncan Champney in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 03-20-2008, 12:53 PM
  4. rotate on mouse click and drag in the direction of the mouse cursor
    By vamsee kanth in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-02-2005, 09:54 PM
  5. Drag Selection
    By merovingian in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-17-2004, 11:24 AM

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