CSCE 4230 Program #4 Due date: Thursday, March 26, 2009 Write an interactive OpenGL program that displays a solid two-segment robot arm by modifying robot.c (OpenGL Programming Guide, p. 157) as follows. 1) Use glutSolidCube in place of glutWireCube. Remove hidden surfaces by using a depth buffer: add GLUT_DEPTH to the call to glutInitDisplayMode and add GL_DEPTH_BUFFER_BIT to the call to glClear. Color the first segment (upper arm) red and the second segment blue. Refer to glColor3f. 2) Change the scale factors (segment shapes) to (4,1,1) for the first segment and (3,1,1) for the second. Note that this requires changes to the translation distances. 3) Allow the user to effectively change the eye position by modifying rotation angles xrot and yrot for x- and y-axis rotations (applied as part of the modelview transformation as the last step before translating down the z-axis): 'x' ==> increase xrot 'X' ==> decrease xrot 'y' ==> increase yrot 'Y' ==> decrease yrot Experiment to find reasonable increments for the angles. The robot arm should be centered in the window and have aspect ratio preserved. The escape key (or a menu selection) should terminate the program. Attach the menu to the right menu button. Email the source code with file name prog4.c or prog4.cpp to Ismail Mohammed: im0058@unt.edu. Also submit a source code listing at the beginning of class on the due date.