Archive Pages Design$type=blogging

Flag of USA

The third Flag program in OpenGL C++ by OpenGL Projects - the flag of usa.

We have already seen two flags Programs  - OpenGL Flag Hoisting program with Our Indian Tricolor and OpenGL program on flag of South Africa. Today in this post we are going to see another flag program. This flag is about USA.


Flag of usa have mainly two parts - one with pattern of stars other the stripes. While maintaining the ration of flag, the pattern has to be drawn in left corner and white and red stripes to rest of the flag. Another problem is the 7 stripes along side of star patterns are smaller in length, we have to keep in mind about it.


First thing is done by drawing the star with GL_TRIANGLE_FAN, using the proper coordinates and angles. Next we draw the pattern of stars using the for loop function with if else conditions, which determines the alternate between rows of five or six stars.

Define a int variable that holds the value of no of stripes(13). This helps in drawing the stripes in loop as well as determine the number of stripes left. This variable also helps in fixing the length of 7 smaller stripes. Alternate stripe colors is done using the if else, and odd even conditions in it. The GL_QUADS has been used to drawn the stripes.

Unlike our other flag programs here we are displaying the whole screen with flag only. Also there is no pole and no hoisting like we have in Computer graphics OpenGL Flag Hoisting program .  You can watch the video demo of this projects on Youtube.

Source Code

Shoot an email to for the Source code of this OpenGL Program, we will sent instruction to get the source code.



3D Bi-Cycle 3D Game 3D Laptop 3D Objects 3D Projects 3D Zoo Algorithm Android Aquarium Bellman-Ford Algorithm B├ęzier curves Block Breaker Blockshooting Bucket Sort C# Chess Clock Code Blocks Colors Complex Project Complex Projects Crab Pong Cross Zero Doll DSAV Escapa Fighter Jet First Come First Serve Flag Flag Hoisting flag of usa Fluids Font Demo Games Gear Motion GlutDino Glutplane Graphics Editor iOS iPhone Java Java OpenGL Graphics Programming Light Torus Linked List Ludo Board Game Mancala board games Martyr’s Monument Memory blocks game Memory Game Menu Mickey Mouse Minesweeper Miniature Steam Engine moth Motion Blur MoveLight moving car Moving Ship Multiplex Networking Based Project Nuclear Power Plant Olympic opengl c++ examples OpenGL ES OpenGL Programming OpenGL Tutorial Origami OS Based Projects Paint Paper Folding Particles Drop Path Finding ping pong Pong Game Project Report Projects Report Puzzles qix like Queuqe Random Flowing lines Ray Rigid Body Rings Robot sample c++ opengl code Screen Saver Screen Saver Ship Shadow Cube Shadowfun Shaheed Minar Ship Iceberg Simple Drawing Simple Haloed Lined Wireframe Simple Move Light Simple Project Simulation SNAKE XENZIA GAME Solar system Sorting Space Invaders Sphere Spot Light Swing Stack Stars Taj Mahal The Edge Game Tic Tac Toe Tower of Hanoi Traffic Signal Transformation Triangular Animation Trippy Tutorial water ripple effects Whirlpool
OpenGL Projects: Flag of USA
Flag of USA
The third Flag program in OpenGL C++ by OpenGL Projects - the flag of usa.
OpenGL Projects
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago