PDA

View Full Version : Coordinates and Frame Buffers



rys
06-24-2004, 09:35 AM
I am trying to draw a picture on the screen and then read the pixel values, reconstruct the image (in a different orientation and location on the screen) and display it again.

My problem is that when I write the initial image, I use real values to specify location (for example: glVertex3f ( 0.3, 0.5, 0.0). Now, the only function I found to read pixel values back is glReadPixels() where I need to specify integer values for pixel location. Is there a way to read a pixel value where I have only the real valued location

I appreciate your help.

Ron

ZbuffeR
06-24-2004, 10:58 AM
It depends on your modelview and projection matrices.
I think the default ones just maps the gl window to the [0 1] interval for both x an y, origin at the lower left. If you know the actual with and height of the window it should be trivial to convert float values to pixel coordinates.