C481 B581 Computer Graphics
Dana Vrajitoru
Homework 3

Due date: Wednesday, February 3.

Ex. 1 Download the following files discussed in class. Compile and run each of the 2 applications to make sure they work:

A Makefile for both programs.

Animation with a small menu program (default for make):

Hello world button program (make hello): Compile the hello world application with the command "make hello" and the animation one with the command make. Run the first one with the command "hello" and the second with the command "anim".

Note. If you completed the lab 1 you don't need to compile and run the hello world application again.

Ex. 2. a. Modify the functionality of the 5 bouncing balls such that they bounce off all the walls. Currently they only bounce off the ground. This should keep them all inside the area at all time. For this you need to modify the function nextBall. To make a ball bounce off any wall, you only need to change the sign of one of the components of the speed.

With this modification, the speed of the balls should be decreasing little by little and after a while they should be lying on the ground. Write a function that resets them back in motion starting from an arbitrary position and speed, as in the beginning. Here is the prototype for this function:

void reset(GtkWidget *button, gpointer data);

This function will be the callback for a menu button.

b. Modify the menus the following way:

Send me: the source file(s) that you modified, individual attachments by email.