Modelling, Transformations, and Viewing
The objective of this assignment is to construct, animate, and view a model of a carousel. The carousel consists of six supporting posts and a hexagonal pointed roof, as shown in the figures below.
Each of the supporting posts should be constructed using scaled instances of the colorcube, as presented in the example program mycube.cpp. The hexagonal roof of the carousel is constructed from six triangular polygons. As shown in the figures, the roof polygons should be colored alternating blue and yellow.
The carousel should be viewed using a perspective projection with a horizontal aspect that is 1.0 times the vertical (use gluPerspective()). Two separate viewpoints should be provided using gluLookAt(). The first of these viewpoints should be straight on from a vertical level about equal to halfway up the support posts. The second viewpoint should be higher, as shown in the second picture below. All views should be looking toward a point at the approximate the center of the carousel structure. The view should be selectable from among these two choices using a menu. Animate the carousel by rotating it slowly about the y-axis. Rotation should be capable of being turned on and off by a menu item.


This assignment is worth 15 points. For 3 extra points, add a brown (r=0.54, g=0.27, b=0.074) floor as shown in the figure below. (This will be a required addition for Assignment 3.)

For two additional points, add a flag at the top of the carousel. This flag should always point in the same direction (direction of the wind) and not rotate with the carousel.
Submissions of the first three programming exercises should be in the form of well-commented source code, preferably written in ANSI C. C++ is also acceptable. Well-commented means that I want a comment for every significant step, even if it consists of only one line of code.
For these simple programs, I request that you simply email me the source code so that I can build the program on my system. Since these programming examples will be relatively short, I prefer that you include all source code in a single file for ease of compilation. Submittal can be by email, with the source code supplied as an attachment.