Flag of USA

The third Flag program in OpenGL C++ by OpenGL Projects - the flag of usa.
Rajeev
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. 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 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…

Post a Comment