Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

FlagsOpenGL

Five Flags Using OpenGL (GLUT)

Overview

This project is made using C++ and OpenGL (GLUT). It draws five national flags using basic OpenGL primitives such as quadrilaterals (GL_QUADS) and polygons (GL_POLYGON).

Flags Included: 1.Germany 2.Austria 3.Russia 4.Italy 5.Bangladesh

Reference:

image

https://www.geogebra.org/calculator

https://www.geeksforgeeks.org/computer-graphics/computer-graphics-2/

Features:

Uses different colors to create national flags.

Demonstrates the use of GL_QUADS for rectangular shapes.

Demonstrates the use of GL_POLYGON and trigonometry to draw a circle.

Uses separate functions for each flag to keep the code organized.

Functions:

Germany()

Draws the German flag using three horizontal stripes:

1.Black 2.Red 3.Yellow 4.Austria()

Draws the Austrian flag using three horizontal stripes:

1.Red 2.White 3.Red

Russia()

Draws the Russian flag using three horizontal stripes:

1.White 2.Blue 3.Red

Italy()

Draws the Italian flag using three vertical stripes:

1.Green 2.White 3.Red 4.circle()

Creates a circle using multiple vertices and trigonometric functions (sin and cos).

Bangladesh() Draws the Bangladesh flag:

1.Green rectangular background

2.Red circle in the center

display()

Calls all flag functions and displays them on the screen.

Concepts Used:

1.OpenGL Graphics Programming 2.GLUT Window Management 3.Color Rendering 4.2D Coordinates 5.Functions and Modular Programming 6.Trigonometric Circle Drawing 7.Requirements 8.C++ 9.OpenGL 10.GLUT / FreeGLUT 11.Code::Blocks or any C++ IDE

How to Run:

1.Open the project in your IDE. 2.Make sure OpenGL and GLUT libraries are configured. 3.Compile the code. 4.Run the program. 5.A window will appear displaying the five flags.

Learning Outcomes:

After completing this project, you will understand:

1.How to draw shapes using OpenGL. 2.How national flags can be created using simple geometric primitives. 3.How colors are applied in OpenGL. 4.How circles can be generated mathematically using sine and cosine functions.

Author: Computer Graphics Laboratory Project Implemented using C++ and OpenGL (GLUT).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors