Program 4 - Interactively Building Objects

Abstract

For this problem you produce a program that add faces to an object.

Outline

This system has a file representation, an interactive interface. It is a way to create more complex 3D objects.

Goals

A goal of this project is to expose you to a number of issues in developing interactive code. These issues include programming issues such as: how you use the pointer to get work done, what pointer driven code does, and how you show the user the current state of the system. It also includes issues such as: how can you design an interface to allow a user to easily get work done. This program also has a goal of allowing you to see some ways of representing objects in a file.

Objectives

You will be able to write interactive code. You will determine a mapping from file descriptions to internal objects and back to a file description. You will make internal states visible to the user so he/she can get work done.

Prerequisite Background

You need to be able to write an OpenGL program, display objects, and control the viewpoint and select items in the view.

Content

Interactive Object Builder

Write a program to interactively build objects. The program starts by reading in a prototype file with an object specification in it. Faces on the object can be selected. Once selected, a point on the face can be selected, this will form a pyramid of the new point and the vertices of the selected face. Basically a face, once selected is removed and is replaced by the pyramid. When you are done you are to save the file so it can be loaded later by the program.

Program modes:

File format:
OBJECT_FILE ::= DESCRIPTION FACES
DESCRTIPTION ::= line of text CR
FACES   ::= NUM_OF_FACES CR FACE*
FACE ::= NUM_OF_VETICES CR VERTEX*
VERTEX ::= X Y Z CR 

Prime the system by hand building a file for a cube. You will probably want menu options for file save and exit.

Above is a way of getting the desired results, of interactively building an object. If you have a better way, feel free to change the specifications. If it is a large change please check with the instructor. Also, since you are trying to improve the system, you will need to explain how your system is better in your report. You also need to address, better for whom and why.

Posttest

Read and understand an ASCII file defining objects. Design a interactive interface to build hierarchies of objects. Program an interactive interface for a first person shooter (FPS) game.