CS 354 Computer Graphics

Project #1 – A 3D Object Browser

Assigned - September 8

Due - September 28 (midnight)

Goal

You are to create an interactive program for reading in and displaying, translating, rotating and zooming a 3D polyhedral object (i.e. an object with only linear edges and planar faces). The input 3D polyhedral object format shall be VRML 2.0 (.wrl files). . You can choose any of the models you like to demonstrate your program. Any graphical user interface (GUI) programming environment can be used to open a window and display the 3D object in wireframe or flat shading. You should be able to resize your window. Besides, you need to interactively translate and rotate the object about one of the three principal coordinate axes. Which one depends on what buttons (mouse or others) you program in your GUI . For example, the left mouse could mean rotate around the x axis, the middle button could be to rotate about the y axis, and the right button could enable rotation about the z axis. Users should also be able to zoom in and out the 3D object view. You should also demonstrate at least two different viewing methods (persepective and orthographic).

Approach

The first step is to create a file parser which will read the information from the ".wrl" file (text file) of the 3D model. The file parser doesn’t have to be generic as long as it will satisfy the needs of your program. The second step is to use functions in the OpenGL library to display the 3D object in perspective or othographic projections in the display window. The last step is to add 3D object translation, rotation and zoom features in your program.

More Information

We will assume students are familiar with Xwindows or whatever alternative GUI programming environment (e.g. , GLUT library, Tcl/Tk, Motif etc. ) they plan to use. Probably, the GLUT library will be very helpful for Xwindows programming. The course will not concentrate on teaching the use of Xwindows or any other windowing environment in detail. Besides, any programming language is acceptable, provided the instructor or TA is familiar enough with it to evaluate the project. Since you will use the Mesa/OpenGL graphics library through this semester, you may wish to have access to the following reference book. You can also find lots of information such as VRML, GLUT library and Mesa/OpenGL online, with links available from the course home page. Please look at "Computing Environment"-> "Machines"->"Using Mesa" part carefully, which may give you an idea how to start using the OpenGL graphics library.

Example application programs using the MesaGL and glut libraries can be found in /p/bin/Mesa. The source code for these examples is in /p/src/Mesa-2.1 . The MesaGL, MesaGLU and glut libraries are in /p/lib/Mesa and the include files needed to use these are in /p/include/Mesa .

Reference book

Neider, Davis and Woo, "OpenGL Programming Guide" Second Edition, Addison-Wesley

Questions Related to Project (10% of project score)

Besides doing the above work, you should also answer the following questions in your short project report:

1. What are the lessons learned in this project, visavis, the GUI programming environment, the API (application programming interface) for Mesa/OpenGL, and the object format of VRML 2.0 ?

2. Is it possible to have both perspective viewing and orthographic viewing from a single viewing model ? If so, how would you achieve this ? Does Mesa/OpenGl provide you enough flexibility to achieve this ? Explain in some detail both a positive and negative answer.

 

What to turn in

This has been explained clearly in the course home page (http://www.cs.utexas.edu/users/rkolluri/cs354/index.html).

Extra Credit

You will get 5 extra points for a well designed user interface as well as well documented code. You are encouraged to use documentation tools such as noweb or doc ++