Thread: Mouse Input - OpenGL

  1. #1
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229

    Mouse Input - OpenGL

    Hi,

    I'm wondering if there is a way I can convert the X and Y coordinates of the mouse (Acquired from SDL_GetMouseState()) to the proper openGL coordinates. I was going to use picking, but if this can be done safely then I would prefer it.

    Thanks,
    David

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    Quote Originally Posted by IdioticCreation
    I was going to use picking, but if this can be done safely then I would prefer it.
    Not entirely sure what you mean there. Picking is just really just object selection - it doesn't give you mouse coords.

    But to get the 3D coords of the mouse, have a look at gluUnProject().
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  3. #3
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Ahhha! gluUnProject was what I needed. Thank you!

  4. #4
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    No prob .
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Curses + Mouse control
    By guesst in forum Linux Programming
    Replies: 0
    Last Post: 05-26-2008, 03:06 PM
  2. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM
  5. Mouse in OpenGL?
    By TheGr8one in forum Game Programming
    Replies: 0
    Last Post: 11-01-2001, 07:19 PM