Results 1 to 2 of 2

Thread: gluUnProject, mouse cords?

  1. #1
    Member Newbie
    Join Date
    Jan 2001
    Location
    Plymouth,NH
    Posts
    40

    gluUnProject, mouse cords?

    I've read all the messages on the board but I don't really understand how I can get all the cords of the mouse when its clicked in 3d space. I just have a flat floor and I want to make it so when I click on the floor I can tell how deep the click is. I have a demo that someone wrote up but the z axis does not change. Any suggestions or source code would be appreciated.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    227

    Re: gluUnProject, mouse cords?

    If you use gluUnproject(winx,winy,winz,.......)
    winz=0 is the near clippingplane and winz=1 the far clipping plane.
    You can use this to get a projectionline and look where it intersects with your floor plane.
    The hard thing will be to get your plane equation for the floor after doing some viewingtransformations.
    yes

Similar Threads

  1. mouse picking in opengl using `gluUnProject`
    By fefefe in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-08-2013, 04:20 PM
  2. trouble using gluUnproject for 3D Mouse Coords
    By neo187 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-02-2011, 06:02 AM
  3. giving Window cords to cubes and manipulation
    By YKingY in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-23-2008, 04:02 AM
  4. Replies: 0
    Last Post: 10-26-2005, 06:06 AM
  5. Env Mapping - Txt Cords needed ?
    By mac_systems in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-24-2004, 09:27 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