When I project a texture from a typical image file (e.g. .bmp, .tga) it appears upside down. Usually when using textures I take care of this in the mapping - no problem. But I can't see any correspondingly simple way to flip the texture when it is being projected. Is there a way to do it, e.g. using the eye planes? I don't want to have to flip all my images in advance, since this could be a real headache, e.g. if I am projecting frames from a video.
thanks
Gib
bakery2k
01-30-2003, 01:10 PM
When you construct the projection matrix, you probably use a scale-bias matrix to convert projected coordinates from [-1, 1] to [0, 1]. e.g.
(0.5, 0.0, 0.0, 0.5,
0.0, 0.5, 0.0, 0.5,
0.0, 0.0, 0.5, 0.5,
0.0, 0.0, 0.0, 1.0)
Change this to flip the images in the Y direction. eg:
(0.5, 0.0, 0.0, 0.5,
0.0,-0.5, 0.0, 0.5,
0.0, 0.0, 0.5, 0.5,
0.0, 0.0, 0.0, 1.0)
Just what I wanted http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks very much.
Gib
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.