Has my texture already been flipped?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Has my texture already been flipped?

fmorat
I  created a texture as follows:

Texture tex = TextureIO.newTexture(new File(textureFileName), false);

I'm printing the result of tex.getMustFlipVertically() and it returns false.

What does this mean? Has the texture already been flipped?

Reply | Threaded
Open this post in threaded view
|

Re: Has my texture already been flipped?

gouessej
Administrator
"Indicates whether this texture's texture coordinates must be flipped vertically in order to properly display the texture. This is handled automatically by getImageTexCoords and getSubImageTexCoords, but applications may generate or otherwise produce texture coordinates which must be corrected."
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Has my texture already been flipped?

fmorat
So, I'm still not sure of what is going on. I know this is obvious to you guys but
please bear with me.

In OpenGL the texture origin is the lower-left corner. This causes the image
to be flipped. However, I'm noticing that when loading the image
and displaying, it is not being flipped. It is being displayed correctly.

And this is what I want to know: Is the method call TextureIO.newTexture(new File(textureFileName), false);
flipping the image?  By your answer I can only assume that YES. However, I do not want
to assume (I've been burned too many times by assuming stuff).

Please help me, is it being flipped?
Reply | Threaded
Open this post in threaded view
|

Re: Has my texture already been flipped?

fmorat
In reply to this post by gouessej
After reading your reply a bit closer I think I understand that now that the texture is indeed
being auto flipped. My question now is, is there any way to stop it from doing that?
Reply | Threaded
Open this post in threaded view
|

Re: Has my texture already been flipped?

gouessej
Administrator
It depends on what you use in the JOGL API. If you use only TextureData, you'll have to take care of the flipping by yourself.
Julien Gouesse | Personal blog | Website