In this assignment you will learn to build complex objects, to test whether complex objects intersect with one another, and to create an animation of a collection of objects which responds to intersections among the objects.
A generation 2 version of the face has a smaller version of the face
in one of the eyes. That is, the eye now serves as the face with
2 eyes and a mouth inside. For example,
A generation 3 version of the face has a smaller version of the face
in each of the eyes. For example,
We can proceed in this way creating generation 4, 5, 6, 7 faces each having more eyes converted to faces. Similarly, generations 8 through 15 add another level of recursion.
What you need to create here is a procedure to generate a face of any generation. Model the face in such a way that it will be easy to move it, to rotate it, ...
Your world will evolve in a rectangular window. The user must be allowed to change the size of the window in standard fashion. You must provide a user interface that allows the user to add new faces to a scene. Every face starts at generation 1 and is always of the same size. The user places it by a mouse click and also gives it a rotation and a velocity with magnitude and direction. The face moves with this velocity until it either hits another face or hits a wall.
The rules for collisions are as follows:
Begin by having one face moving in the rectangular window. When you're comfortable with this, introduce another face. As things progress, add more faces.
Very easy changes you can make are to replace circles living within circles by triangles living within triangles or squares living within squares. You might want to do this as a test of the quality of your code. It should be a simple change. You will get partial credit for doing this change and no other.
A related change that is acceptable is to raise the entire environment to 3D. Replace circles by spheres and triangles by polyhedra. Collision detection isn't much harder but you must handle various viewing issues.