Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Urgent--texture mapping and gluUnProject

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Posts
    6

    Urgent--texture mapping and gluUnProject

    hi group,
    How can I get the coordinates of mouse position on a texture to detect and change the texture of that part?
    Soner SEN

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Urgent--texture mapping and gluUnProject

    This is not that trivial.
    You can use gluUnProject to get the mouse position in space. You need the inverses of the applied matrices for the reverse mapping from world to model space. If you have found the polygon you clicked on, you'll have to re-map to texture space including perspective correction.

    I haven't looked at it yet, but on the NVIDIA developer pages there is a demo which shows the footprint of a texture. Probably all the above methods are in there.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Posts
    6

    Re: Urgent--texture mapping and gluUnProject

    thanx for your help.
    I tried gluUnProject, however I confused with the z position of the window.
    also I tried it on a sphere created by gluSphere and gluQuadricTexture.

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Urgent--texture mapping and gluUnProject

    Performa a search on gluUnProject on this forum and you'll find code for it.

  5. #5
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    2
    Did you ever find a solution? I also need urgent help with this exact same problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •