Project 1

CSE 167: Computer Graphics

 

Project 1: Make a program that renders a simple 3D object (such as a cube). It should render several copies of the object in different positions/rotations viewed with a perspective camera. The goal of this project is simply to get familiar with the compiler and OpenGL (or another 3D rendering API of your choice).

 

The program does not need to do any lighting, but I suggest coloring each triangle differently.

 

You can use C++ or Java, or another object oriented programming language of your choice. You can use OpenGL, GLUT, Direct3D, Java3D, or a similar 3D rendering API.

 

Please render the individual vertices and triangles, and donít use any higher level drawing functions (such as glutSolidCube(), etc.).

 

Object Oriented Approach

Although not required for project 1, I would suggest taking an object oriented approach that will allow you to add features as the course goes on. For example, I suggest starting with some sort of Model class that contains an array of triangles. Something like this:

 

class Vertex {

††††††††††† Vector3 Position;

††††††††††† Vector3 Color;

public:

††††††††††† void Draw();

};

 

class Triangle {

††††††††††† Vertex Vert[3];

public:

††††††††††† void Draw();

};

 

class Model {

††††††††††† int NumTris;

††††††††††† Triangle *Tri;

public:

††††††††††† void Draw();

††††††††††† void CreateBox(float xsize,float ysize,float zsize);

};