View Full Version : why i write tiff file left and right reversed

11-05-2005, 04:32 PM
I use tifflib LibTIFF TIFF Library
My GL effect anticlockwise ,but render tiff file is widdershins.I render tga file is well!
Any suggestions? Thanks in advance.


glReadPixels(0, 0, _width, _height, GL_RGBA, GL_UNSIGNED_BYTE, data);
TIFFWriteEncodedStrip(tif, 0, raster, _width * _height *4);

11-09-2005, 01:07 AM
Maybe the TIFF library coordinates are different from OpenGL's. OpenGL texture coordinates have their origin at the bottom left of the image. The majority of the image file formats have their origin at upper left corner of the image. You can solve this by yourself moving the pixels of the image or scaling the OpenGL texture transformation matrix by a factor of -1 in the X axis.

11-09-2005, 07:58 PM
yourself moving the pixels of the image[/QB]Thanks Azdo! suggest very useful!