Comp 360 Lab 1 : Affine Graphics

Due Wednesday, 5 October 2011, 11:59 PM

Overview

In this project you will render simple and complex two dimensional shapes. You will also create transformations for these shapes and generate fractals using iterated function systems.
This project is due on Wednesday, 5 October, 2011, 11:59 PM. It is worth 100 points.
For this lab you will work with two or three other people. As soon as possible, send an email with your partners' names and usernames to linda.hill@rice.edu. If you have trouble finding a group, let us know and we will try to find one for you.

Specification

Using OpenGL, Glut, and Fltk, you will design the user interface for this program which will consist of a Geometry Editor and a Transformation editor. The global coordinate system is set up so that the origin lies in the upper left-hand corner of the program window, the x-axis increases horizontally to the right, and the y-axis increases downward.
The first portion of the lab involves implementing basic shapes in the Geometry Editor. Clicking on the shape's button will draw the basic shape using OpenGL. Your shapes must be able to move around when selected with the mouse. In addition vertices should be highlighted when the mouse hovers over them and the vertices must have the ability to be dragged by the mouse to change the objects' shape.

The second portion of the lab involves creating tranformations by mapping three points at the vertices of a base triangle to three (possibly different) points on the base triangle.

The third portion of the lab is to integrate the shape editor and the transformation editor to create fractals.

In parts four and five you will be asked to create a few specific fractals as well as several fractals of your own design.

Part 1a: Simple Shapes

Create a base triangle in the center of the Geometry Editor.

Create buttons to add the following shapes to the screen:

Part 1b: Basic GUI Functions in the Geometry Editor

Once your Geometry Editor can handle the these shapes, add the below functionality to the editor: It is not necessary to allow the base triangle in the Geometry Editor to be manipulated the way it is in the demo.

Part 2a: Basic GUI functions in the Transformation Editor

In the Transformation Editor you will create the transformations that will manipulate the shapes you are using in the Geometry Editor.
Create the following buttons for the base triangle:


The Grid on the base triangle should create equidistant points on the edges and in the interior of the triangle. These points will be used to place transformation triangles at precise locations on top of the base triangle. Dragging a transformation triangle's vertex with the mouse near a point on the grid should cause the vertex of the transformation triangle to snap to this point on the grid.

2b. Create Transformations

Transformations are created by mapping the three vertices of the base triangle to three (possibly different) points on the base triangle. The actual base triangle should not have the ability to move. The mapping is done by adding an additional triangle on top of the base triangle and moving the vertices of the new triangle to points on the grid of the base triangle. Multiple triangles should be added to created compound transformations. The transformations should allow for rotation, scaling, and translation.

Create the following buttons to handle the transformation triangles:

3. Integrate the Geometry and Transformation Editors

The Geometry Editor should have the ability to apply the transformations created in the Transformation Editor to the shapes selected in the Geometry Editor. A shape should be selected in the Geometry Editor by right-clicking on the shape.

Add the following button to the Transformation Editor: Add the following buttons to the Geometry Editor:

4. Create fractals using the Geometry Editor and the Transformation Editor

Fractals should be independent of their base cases. So when creating your fractal, you can build your fractal using any of the selected shapes from the Geometry Editor. Please take screen shots of your fractals in the Geometry Editor as well as screen shots of the transformations used in the Transformation Editor to create your fractals.

Create the following fractals:

5. Create at least five fun fractals of your own design

As with the above fractals please take screen shots of the fractals you create in the Geometry Editor as well as screen shots of the transformations used in the Transformation Editor to create your fractals.

Part of your grade will depend on the originality and elegance of the fractals you create.

Code For Your Use

You can use the following files:

What To Turn In

Create the directory lab2. This directory should contain your source code and all files needed to build your program in Visual Studio (or a CMakeList.txt file). Also include the screen shots of your fractals and transformations and a README file containing: Part of your grade will depend on the originality and elegance of the fractals you create.
Only one partner per group should turn in code.
If your project will be completed late, email the TA (lkh3@rice.edu).
Please follow the instruction on the COMP 360 home page to submit your lab.



File translated from TEX by TTH, version 3.85.
On 15 Sep 2009, 10:10.