Results 1 to 2 of 2

Thread: how to select a rectangle with mouse

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    3

    how to select a rectangle with mouse

    Hi,
    I have 2 blue rectangles drawn with gl_line_loop.
    if I click one of them with mouse I want it to be red. So an object selection problem.
    I use ortho projection.

    if you could give some sample code it would be very helpful.
    Since I m extremely newbie, if you mention where should I put the code(mousedown,render?) it will would be nice for me.
    Thanks for help.regards

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: how to select a rectangle with mouse

    Hi !

    Here is one example that use GLUT: http://www.sdsc.edu/~mjb/cse167/Hand...ng/picking.pdf

    There are lots of others, give google a quick search and you will get lots of examples.

    Mikael

Similar Threads

  1. How to select vertex3f on mouse click
    By woolfik in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 09-07-2015, 06:46 AM
  2. Select source rectangle from video texturing
    By Harikumar in forum OpenGL ES
    Replies: 0
    Last Post: 01-27-2014, 06:09 AM
  3. How to select a point and move with mouse
    By apoorv in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-09-2013, 10:43 AM
  4. Select single vertex with the mouse
    By DonDickieD in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 04-24-2002, 06:19 AM
  5. using mouse coordinates to select an object in 3d
    By dodgyposse in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 09-12-2000, 05:41 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