I’m trying to write a pretty simple app with a ball bouncing around the inside of a box. Basically, I’m wondering what the best way to go about this is. Ideally, I could save the angle the ball is traveling in and then just move it a bit in that direction every time I call display (with some collision detection for the walls, of course).
So what I wanted to do was somehow save a snapshot of the modelview matrix every time I go through display so that when I come back I can pick up where I left off. I know that I could calculate the new coordinates and save them and then call glTranslate but it seems like saving the matrix would be a lot cleaner. Anyway, just wondering, thanks in advance.