mirror image problem?
Here's a problem which I'd image is fairly common. But I don't know
the terminology so I don't know what to search for. I suppose this
is like a mirror image problem?
I've got a photoshop image (that looks fine) and then I save it off
in targa format. My openGL program reads in the
data and displays it as a texture. It seems to be displaying as
if one walked behind it. For instance,
The image in photoshop Displayed in my program
FRONT TNORF (only all the letters face left)
Is there a simple command that I can use to fix this?
I'm thinking that I could tweak the way the data is read in. In stead of
filling in my buffer from 0 to maxSize, maybe fill in the data from maxSize
to 0?
Another mystery is photographs. I've got photos that are fine in photoshop
but when displayed the photographs are orientated on their sides.
the terminology so I don't know what to search for. I suppose this
is like a mirror image problem?
I've got a photoshop image (that looks fine) and then I save it off
in targa format. My openGL program reads in the
data and displays it as a texture. It seems to be displaying as
if one walked behind it. For instance,
The image in photoshop Displayed in my program
FRONT TNORF (only all the letters face left)
Is there a simple command that I can use to fix this?
I'm thinking that I could tweak the way the data is read in. In stead of
filling in my buffer from 0 to maxSize, maybe fill in the data from maxSize
to 0?
Another mystery is photographs. I've got photos that are fine in photoshop
but when displayed the photographs are orientated on their sides.
to get a horizontal flip, you must be doing something horribly wrong 
vertical flips are common, since most image formats use coordinate systems upside down from OpenGL's.

vertical flips are common, since most image formats use coordinate systems upside down from OpenGL's.
You can fix horizontal or vertical flips just by changing your texture coordinates. For the typical vertical flip, texcoord T would just be set to 1-T.
If the way you read input "disagrees" with the way Photoshop writes, you'd have to either get a new graphics reading library or flip coordinates accordingly.
If the way you read input "disagrees" with the way Photoshop writes, you'd have to either get a new graphics reading library or flip coordinates accordingly.
Duh. Thanks alot. That was relatively painless.
Before:
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f( x, y, 0.0);
glTexCoord2f(1.0f, 0.0f); glVertex3f( x, y+side, 0.0);
glTexCoord2f(1.0f, 1.0f); glVertex3f( x+side, y+side, 0.0);
glTexCoord2f(0.0f, 1.0f); glVertex3f( x+side, y, 0.0);
glEnd();
After:
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f( x, y, 0.0);
glTexCoord2f(1.0f, 0.0f); glVertex3f( x+side, y, 0.0);
glTexCoord2f(1.0f, 1.0f); glVertex3f( x+side, y+side, 0.0);
glTexCoord2f(0.0f, 1.0f); glVertex3f( x, y+side, 0.0);
glEnd();
Well, at least now I've not got a secret Leonardo Da Vinci Coder Ring. (Mirror writing)
Before:
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f( x, y, 0.0);
glTexCoord2f(1.0f, 0.0f); glVertex3f( x, y+side, 0.0);
glTexCoord2f(1.0f, 1.0f); glVertex3f( x+side, y+side, 0.0);
glTexCoord2f(0.0f, 1.0f); glVertex3f( x+side, y, 0.0);
glEnd();
After:
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f( x, y, 0.0);
glTexCoord2f(1.0f, 0.0f); glVertex3f( x+side, y, 0.0);
glTexCoord2f(1.0f, 1.0f); glVertex3f( x+side, y+side, 0.0);
glTexCoord2f(0.0f, 1.0f); glVertex3f( x, y+side, 0.0);
glEnd();
Well, at least now I've not got a secret Leonardo Da Vinci Coder Ring. (Mirror writing)
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| SDL Mirror Image | beg1689 | 4 | 3,783 |
Sep 23, 2005 03:20 PM Last Post: Duane |
|
| OGL Image Problem | Sta7ic | 2 | 2,175 |
Jul 27, 2003 06:32 PM Last Post: Mark Levin |
|

