Mouse Input - OpenGL

This is a discussion on Mouse Input - OpenGL within the Game Programming forums, part of the General Programming Boards category; Hi, I'm wondering if there is a way I can convert the X and Y coordinates of the mouse (Acquired ...

  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,070
    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().
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  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,070
    No prob .
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

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, 04: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, 09:01 PM
  5. Mouse in OpenGL?
    By TheGr8one in forum Game Programming
    Replies: 0
    Last Post: 11-01-2001, 06:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21