Is there an easy way to do collision in OpenGl. I’m not talking complex 3D collision…
I’ve written a very simple(if not crude) game with a bouncing ball(actually a squae) that bounces around the screen and tries to hit squares at the top…you have a moving platform to catch and reflect it at the bottom(remeber Arkanoid?)…Anyway, I can’t sem to get anywhere near accurate results. Everything is drawn with Quads…the platform, the “ball” and the blocks at the top of the screen(all in 2D) This is how I do my testing…
I test whether the upper left corner of the bouncing block is greater then the lower right corner of the target and if the upper right corner of the bouncing block is less than the lower right corner of the target and if the top of the block is equal to the bottom of the target…(And that’s just for the bottom side of the target!)
I’m sure that sounds confusing and very crude testing but it’s the only way I could think of doing it(obviously I’m a begginner=).
So, is there anyway I can define a region of my screen and have OpenGl keep up with whether my little block is whithin that region? (Sorry about all the details) Any help would be greatly appreciated…Is there a GLUT function call or something?