Challenges
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.
Approach
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 openglprojects@gmail.com for the Source code of this OpenGL Program, we will sent instruction to get the source code.