Project 1: Playing with 3D Objects Using GLUI
Fall 2001   CS 354   Computer Graphics
Due: September 24, 11:59pm


Goal
In this project you will draw simple three dimensional objects and show them changing as you change their parameters through your graphical user interface (GUI). This way you will get introduced to the graphics library OpenGL and also to the new user interface library GLUI.

Project Specifications
The demo program draws a cone and allows you to move it, change its size, color and sub-division parameters through the GUI. Now you have to add a solid torus in the scene and allow the user to move it (rotate, give XY & Z movements), change its size (inner & outer radii), change its color and change its sub-division parameters (number of sides & rings). The user should be able to change the cone or the torus independent of the other, but also make an arrangement such that the user can move the cone and the torus simultaneously. Your program should compile and run on the Taylor or Painter basement machines.

Getting Started and Suggested Approach
First read the Lab Setup  link from the course home page.
Download the demo program files all in one directory. To download the files from Netscape, hold down the SHIFT key before clicking on the name of the file. The program will run only on the Dell Linux machines in Taylor and Painter basement labs (see the GLUI information below if you want to run it on other machines or if you want to look at more GLUI examples).  To compile it, type "make BOX=dell". This will produce an executable "demo". To run it, type "demo". You will see a cone and a GUI. Play around with this cone using the GUI.

This program uses the OpenGL graphics library to draw the object and GLUI library to make the graphical user interface. Try to understand how the interface is being made (in the initialize_interface() funtion in main.cpp). Refer this GLUI manual  to understand what each function is doing. Next try to understand how the cone is being made and displayed using various OpenGL and GLUT functions.  The cone is being drawn directly by the function glutSolidCone(). Refer OpenGL reference book to understand what the various functions are doing. For this project you may ignore lighting and shading functions (as used in the initLighting() function).

Next understand how a torus can be drawn using glutSolidTorus() function. Expand the user interface to allow all the required flexibility for drawing the torus.

Questions Related to the Project (20% of the project grade)
1. What are live variables and why are they useful?
2. How can one change the objects using mouse and keyboard but without using the GLUI library? How much is this convenient for the user as compared to changing the objects using GLUI library?
3. In this project you used the direct function available to make cone. How will you construct a cone in OpenGL without using this function?

What and how to submit
Your program should compile and run on the Taylor or Painter basement machines. Then submit the following files:

     Source code  (.cpp and .h files)
     Executable
     README
     Report
     Makefile

You don't need to submit the GLUI library file libglui.a file if you are using the one provided.

The README file should be a plain text file, it should clearly mention: your name, what the submitted files contain (e.g. which is the executable, which contain the source code etc.) and which machines it compiles and runs.

The report should also be a plain text file which should contain the answer to the above "Questions Related to the Project". In addition, if appropriate, you may also write about what extra things you did in the project, what  new ideas you came up with, what design decisions you took etc; please keep such a  discussion short and to the point.

Use the turnin program to submit your files. You have to turnin to: rjkate cs354-project1
Here  is a short note on how to use turnin program.

Refer the "Grading" section  in the "Syllabus" link on the course home page  for grading and late policy.

GLUI Information
GLUI is a new GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. You can learn more about it  here . In this project the glui library "libglui.a" was made by compiling GLUI version 2.1 on one of the Dell Linux machines in Taylor/Painter basement lab, hence the provided demo program will compile only on those machines. If you want to use GLUI on any other machine, then you need to generate its library for that machine. For doing this, download version 2.1 from the above site, unzip and untar it.  Read its readme.txt file. You need to make certain changes to the makefile to compile it. This makefile was used to compile it on Dell Linux machine (you also need to create lib/ and bin/ empty directories to hold the library and the example executables). You may also play around with the example programs which it generates (some of them also draw torus). For the Dell Linux machines, all these things are present at ~rjkate/cs354/glui_v2_1_beta/

OpenGl Reference book
Neider, Davis and Woo, "OpenGL Programming Guide" Second Edition, Addison-Wesley
You may also see the course home page for various OpenGl  links.