Reversing Up-Vector of the camera

Hi,
I have a texture(jpg) and when I map it to a cylinder OpenGL maps it upside down(I do not know why?)!
Now I decided to reverse my Up-Vector instead of rotating my texture which is(I think) computationally expensive.
Here is my code:
gluLookAt(0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0);

Is it a good idea?

Why don’t you just mirror the UVs?

In general, GL functions assume (1, 1) is to the right and up from (0, 0). TexImage2D assumes data for (0, 0) come in first and (1, 1) come in last. Your image loading routine might assume top row first.

Mirroring UV like thokra advised is efficient and easy fix.

Thanks,
When I use JIG’s jpeg-8 library the image is mapped upside down, but when I use FreeImage library everything is OK.

Some libraries already flip the image in anticipation that it will be used as an OpenGL texture, others simply give you the data in the file, and some allow you to configure this. Check the documentation of the libs to see if you can make them behave consistently (if you need to keep the option to use both) or just pick one and stick with it :wink:

When I use JIG’s jpeg-8 library the image is mapped upside down, but when I use FreeImage library everything is OK.

I second to carsten’s reply. Images like BMP (MS version) arrange data such that the first row is last and last row is first. So you need to first check the file format and then check with the library.