This is an assignment of "Drawing of Ghana National Flag in C++ by using OpenGL."
If there is anything wrong, then you will see forgiveness.
Thank you...
1. Assignment
Drawing of Ghana National Flag in C++ by using OpenGL
Submitted by
Name : SH Rajøn
Batch : 1410
Student of Department of Computer Science and Engineering 0f IUBAT
IUBAT- International University of Business Agriculture and Technology
Date : 25/07/2018
2. Figure: Ghana National Flag
In this flag there are five primitives are used. Three of them is Quad,one is
triangle.
Assignment’s Description:
This Computer Graphics Assignments as mentioned above draw Flag of Ghana.
As we can see in the Assignments output image above. In this Assignment, there is
no user interaction as well as the Assignment is static one. A basic OpenGL
program has included header files, global variable declaration, draw function, init
function and main function. This program has only these basic functions, since it
not required having anything else. Just draw the primitives to give a propershape
of flag.
3. Drawing Function for Geometrical Primitives:
For drawing this flag, we need only five geometrical primitives, three of them is
quad,one is triangle and another one in polygon. All objects in this Assignment is
included in draw function. As we can see the flag has four part of different color.
We have use the glBegin(GL_QUADS) to draw the quad shapes, and
glBegin(GL_TRIANGLES) is use to draw the triangle.
First Primitives (1stQuad):
Here is the graph for first primitive of that flag
Codefor this primitive:
glColor3f(0.698, 0.133, 0.133);
glBegin(GL_QUADS);
glVertex2d(30.0,15.0);
glVertex2d(30.0,5.0);