This is an assignment of "Drawing of Niger National Flag in C++ by using OpenGL."
If there is anything wrong, then you will see forgiveness.
Thank you...
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Niger National Flag
1. Assignment
Drawing of Niger 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 : 18th March,2020
2.
3. Figure: Niger National Flag
In this flag there are fourth primitives are used.
Assignment’s Description:
This Computer Graphics Assignments as mentioned above draw Flag of Niger.
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.
4. 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);
glVertex2d(-30.0,5.0);
glVertex2d(-30.0,15.0);
glEnd();
glFlush();
5. SecondPrimitive (2nd Quad):
Here is the graph for Second primitive of the flag
Codefor this primitive:
glColor3f(1.000, 0.843, 0.000);
glBegin(GL_QUADS);
glVertex2d(30.0,5.0);
glVertex2d(30.0,-5.0);
glVertex2d(-30.0,-5.0);
glVertex2d(-30.0,5.0);
glEnd();
glFlush();
6. Third Primitive (3rd
Quad):
Here is the graph for Third primitive of the flag
Codefor this primitive:
glColor3f((-30.0,5.0);
glBegin(GL_QUADS);
glVertex2d(30.0,-5.0);
glVertex2d(30.0,-15.0);
glVertex2d(-30.0,-15.0);
glVertex2d(-30.0,-5.0);
glEnd();
glFlush();
7. Fourth Primitive (Circle):
Here is the graph for fourth primitive of the flag
Codefor this primitive:
glPushMatrix();
glColor3f(255,140,0);
glScalef(1.9,1.5,1.5);
glutSolidSphere(3,50.5,2);
glPopMatrix();
glEnd();
glFlush();
}
8. Code:
//Name : SH Rajøn
//ID : 1410
//Assignment No : 1
//Assignment Name : Flag of Niger
#include<windows.h>
#include<GL/glut.h>
void flag()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(255,140,0);
glBegin(GL_QUADS);
glVertex2d(30.0,15.0);
glVertex2d(30.0,5.0);
glVertex2d(-30.0,5.0);
glVertex2d(-30.0,15.0);
glEnd();
glFlush();
glColor3f(255,255,255);
glBegin(GL_QUADS);
glVertex2d(30.0,5.0);