PDA

View Full Version : Flipping image (no pun intended ;-)



Solvik
03-30-2005, 07:39 AM
Hi, I am trying to flip the (whole) image stored in the color buffer (horizontally or vertically). I realize this is done with glCopyPixels() using zoom factor -1. I also know to call glReadBuffer() and glDrawBuffer() to set the source and destination buffers.

The image does not appear correctly flipped, but is "doubled", i.e. I see the flipped image on top of the original image. I suspect the problem is that the source and destination regions "overlap" (they are actually identical because I am flipping the whole image).

Q1. Can anyone verify that this is indeed the problem?

I have tried to avoid the (suspected) problem by flipping to an auxiliary buffer. However, I find that auxiliary buffers are not implemented! (I am using Windows XP's standard openGL implementation). This is confirmed by the documentation and by the fact that querying the obtained pixel format for its number of auxiliary buffers returns 0.

Q2. Does anyone know how to successfully flip an image?

Any help will be greatly appreciated.

dvm
03-30-2005, 07:51 AM
Hmm, maybe there's a blending mode enable by default. For example, when texturing, the default mode is GL_MODULATE or something, when you need GL_REPLACE. So I'm guessing that it might be blending the 2 images together. Just some thought for food :)

DesT
03-30-2005, 08:50 AM
First question: Отзовитесь, пожалуйста, те , кто понимает русский язык (ибо с англлийским уменя плоховато)!!!
Second question: I bind texture to object, but when I rotate object< texture not rotates!!! Please help to solve this problem.

dvm
03-30-2005, 11:32 AM
First question: I can't see what you're writing.
Second question: check out glTexGen.