WPI Computer Science Department

Computer Science Department

CS 4731, B Term 2016, Homework 2

Homework 2: Due Tuesday November 22, 2016 by 11.59PM (12.5/100 points)

Homework 2 Overview

In this project, you will load a mesh stored in the .ply file format, render it as a 3D wireframe model using Vertex Buffer Objects and also add keyboard control that lets us move the .ply file around. A few optional preparation steps are suggested. You will not turn in the code which you generate in your preparatory steps.


Behavior of your submitted program

PLY File format

This file format, also known as the Stanford Triangle Format, looks like:

File Text

What you should do


If not present, exit

Format ascii 1.0

Skip line

element vertex 758

Read # of vertices (758)

property float32 x

property float32 y

property float32 z

Skip these lines

element face 1140

Read # of polygons (1140)

property list uint8 int32 vertex_indices

Skip line


End of header section ? skip line

6.5 -7.2 1.1

0.5 0.8 -1.5

1.2 9.0 5.5


Coords of Vertex #0

Coords of Vertex #1

Coords of Vertex #2

And so on, until Vertex #757

3 1 9 8

3 5 10 5

3 7 0 9


First no.=#vertices in polygon. In our case, it?s always 3. Then the next three numbers tell you which vertices make up that polygon. So, triangle #1 is made from vertices #1, #9, and #8.

Submitting Your Work

Make sure to double-check that everything works before submitting. Submit all your executable and source files. Put all your work files (Visual Studio solution, OpenGL program, shaders, executable and input files into a folder and zip it. Essentially, after your project is complete, just zip the project directory created by Visual Studio. Submit your zip file using InstructAssist at [ https://ia.wpi.edu/cs4731/] . Do not email me your program or submit it via dropbox. To make your submission smaller, delete the \ipch folder in the visual studio. On recompilation, Visual Studio will regenerate this folder without problems.

Create documentation for your program and submit it along with the project inside the zip file. Your documentation can be either a pure ASCII text or Microsoft Word file. The documentation does not have to be long. Briefly describe the structure of your program, what each file turned in contains. Explain briefly what each module does and tie in your filenames. Most importantly, give clear instructions on how to compile and run your program. MAKE SURE IT RUNS IN THE ZOOLAB before submission. Name your zip file according to the convention FirstName_lastName_hw2.zip

[Feedback] [Search Our Web] [Help & Index]

[Return to the WPI Homepage] [Return to CS Homepage]