Jump to content
  • Advertisement
Sign in to follow this  

images appearing upside down?

This topic is 4773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If OGL is anything like DirectX regarding textures then cant u invert the texture coordinates?


Share this post

Link to post
Share on other sites
try to rotate the GL_TEXTURE like this

try to swap the array buffers like
unsigned char tmp=new unsigned char[image.size];
for (int i=0;i<image.size;i++)
for (i=0;i<image.size;i++)
delete []tmp;

something like this ..
i hope you get it :)

Share this post

Link to post
Share on other sites
Are you sure they're upside down and not mirrored horizontally?

If they're mirrored horizontally it's because you haven't taken into account the fact that opengl coordinates conventionally put 0,0 at the bottom left of the screen.

You can fix this several ways
- Invert the y component of your texture coordinates
- Create the texture the other way up

The latter is often a nicer approach.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!