mark-w
06-13-2005, 07:27 PM
Hi everyone,
I texture mapped an image to a quad. I just want to display this image quickly as an image viewer. I used texture mapping to take advantage of fast panning/zooming/interpolation.
When my mouse is moving over the image view, I would like to know what pixel that corresponds to of my original image.
I made my quad be of size 256x256. And my image is 256x256 pixels. So there is a 1:1 relationship. I was thinking if maybe I could shoot a ray into my quad, and if it intersects the quad at location x:34.3 y:120.16, I could safely say that I am moving the mouse then over 34,120 in my original image.
Is this the way to do it? I am new to this, so if there is an obvious solution, don't hesitate to give me a heads up, thanks!
I texture mapped an image to a quad. I just want to display this image quickly as an image viewer. I used texture mapping to take advantage of fast panning/zooming/interpolation.
When my mouse is moving over the image view, I would like to know what pixel that corresponds to of my original image.
I made my quad be of size 256x256. And my image is 256x256 pixels. So there is a 1:1 relationship. I was thinking if maybe I could shoot a ray into my quad, and if it intersects the quad at location x:34.3 y:120.16, I could safely say that I am moving the mouse then over 34,120 in my original image.
Is this the way to do it? I am new to this, so if there is an obvious solution, don't hesitate to give me a heads up, thanks!