Prerequisite – OpenGL
OpenGL is a cross-language, cross-platform API for rendering 2D and 3D Vector Graphics. Using this, we can make a lot of design as well as animations. Below is a simple Game made using OpenGL.
Description : In this, a ball is moving starting from middle and goes to up-left in starting. But, then it collides with wall and changes direction but speed remain same. Consequently, it comes to downward direction where it should be catched on a rectangle (which is capable of moving in horizontal direction) in order to continue.
For working on Ubuntu operating system:
gcc filename.c -lGL -lGLU -lglut -lm where filename.c is the name of the file with which this program is saved.
Below is the screenshot of the animation. This screenshot is of one instance. In actual, ball will move in different direction which should be catched on the smaller rectangle. Rectangle can be moved to left by pressing lowercase b and towards right by lowercase n. However, this can be changed by changing the code in keyboard function where ASCII value of key can be changed.
This article is contributed by Aditya Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- OpenGL program for simple Animation (Revolution) in C
- Python | Catching the ball game
- Getting started with OpenGL
- Basic Transformations in OPENGL
- Creating animations using Transformations in OpenGL
- Rendering a Triangle using OpenGL(using Shaders)
- OpenGL Rendering Pipeline | An Overview
- Scan-line Polygon filling using OPENGL in C
- scanf() and fscanf() in C - Simple Yet Poweful
- Python | Simple GUI calculator using Tkinter
- Simple Chat Room using Python
- Python | Simple registration form using Tkinter
- Hangman Game in Python
- Implementation of Minesweeper Game
- A Number Link Game