PDA

View Full Version : Image Transitions...



Ehsan_Liverpool
08-07-2011, 01:59 AM
Hi everybody!

Hi i was just wondering how i could do some image transitions, such as fade out.. or slide.. now the idea that i had was i texturized 2 images beside each other and i wanted to move the camera using ortho2d

void update(int value) {
_xview += 2.0f;
if (_xview > 480) {
_xview -= 30;
}
gluOrtho2D(0.0, _xview, 0.0 , height);
glutPostRedisplay();
glutTimerFunc(20, update, 0);
}

but for some reason (I'm pretty sure its a stupid mistake) this doesn't work. so any sort of help would be appreciated :) and also ideas for other image transitions too. :) thnx!

carsten neumann
08-07-2011, 12:13 PM
I'd suggest to not move the camera but the textured quads you use to draw the images, that way two or more of them can move in independent directions.



but for some reason this doesn't work.


Please put yourself in the position of everyone else reading the above: how can we know what "it doesn't work" means?

Your gluOrtho2D call makes the view frustum wider, if you want it to move it to the left/right it should look more like this:



gluOrtho2D(xpos, xpos + width, 0, height);

Ehsan_Liverpool
08-08-2011, 01:52 AM
what i meant by it doesn't work was, that it wont move gluortho2d. i get the same page.. thanks for the help :) greatly appreciate it :)

BionicBytes
08-08-2011, 02:29 AM
You might find it easier to do this the other way round; that is move the quads displaying the texture (array) across the view port (the camera).

Ehsan_Liverpool
08-08-2011, 06:14 AM
i tried moving the quads and got it to work :) thanx! any ideas on other types of image transitions? :)