-
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
-
Senior Member
OpenGL Guru
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.
-
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.
-
Senior Member
OpenGL Guru
Re: Urgent--texture mapping and gluUnProject
Performa a search on gluUnProject on this forum and you'll find code for it.
-
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
-
Forum Rules