PDA

View Full Version : why



03-01-2001, 09:26 PM
ReadJPEG("1.jpg", &pixels, &w, &h, &c);


after i readin the image, why is it upside down? how can i flip it to normal view version? how can i flip it vertically and horizontally? thanks for helping.

Bob
03-03-2001, 12:10 PM
How do you use it, and how do you know it's up side down? It can be your code that draws the image in the wrong way, or are you completely sure that this one is correct?

One possible way can be that if you use it as a texture, make sure you have the origin in the right place. In OpenGL, the origin is in the lower left corner, and not the upper left as one would think.

[This message has been edited by Bob (edited 03-03-2001).]

Deiussum
03-03-2001, 05:10 PM
If you do need to flip the data, you simply need to do a pair of nested for loops that swaps the pixels from start to end. If you're not sure how to do this, I'd suggest learning C/C++ better before jumping into OpenGL.

03-03-2001, 05:44 PM
why dont you just draw it upside down....
(or right side up in this case)