Please submit your programming assignments electronically via ftp. As we will handle a fairly large number of assignments we ask you to comply with some (simple) rules. In the following we guide you through the submission for assignment N (replace the N by the number of the assignment sheet) of student Firstname Lastname:
Notes
> gtar czf LASTNAME.FIRSTNAME.VERSION.AN.tgz AN/Notes
ftp ftp.mpi-sb.mpg.de
Name: anonymous
Password: myemail@somewhere.net
> binary
> cd /pub/incoming/ag4-gm
> put LASTNAME.FIRSTNAME.VERSION.AN.tgz
> quit
Notes:
Finally we give an example for student Hans Meier and assignment sheet 1:
src> ls A1
Makefile a1.cc data.txt
src> gtar czf MEIER.HANS.01.A1.tgz A1
src> ftp ftp.mpi-sb.mpg.de
> Name: anonymous
> Password: hans.meier@web.de
> binary
> cd /pub/incoming/ag4-gm
> put MEIER.HANS.01.A1.tgz
> quit
In case Hans wants to submit another version because he edited a1.cc and/or added a file a2.cc, he would just repeat the procedure choosing the file name MEIER.HANS.02.A1.tgz instead, etc.
Some counter examples including common mistakes: the following file names are not acceptable for Hans Meier: MEIER_HANS_02_A2.tgz, MEIER.HANS.02.A2.tar.gz, MEIER.HANS.02.AN.tgz, MEIER.HANS.02.ASSIGNMENT2.tgz,... Please follow the above conventions strictly.
Please do the programming assignments in C/C++. We will use GNU g++ (3.3.5) as reference compiler, your code must compile with g++. Additionally we expect a simple (gmake) Makefile (example) that will (a) compile your source files and (b) execute the resulting binary file with the provided data as input and so create the desired output (e.g. a PostScript file). The last step includes the use of an additional tool like gnuplot. Most programs will read some ASCII input file and write some output file. The output may then be processed by a visualization tool such as gnuplot. We use a simple ASCII file format for input and provide you some code for reading.
Requirements:
Notes:
We provide a small library of C++ functions and classes that you may use if you like. Download the library and examples or browse the documentation.
Note
is a visualization tool that we will use for displaying curves/polygons.
shell> gnuplot
gnuplot> plot 'gm.txt' with lines
gnuplot> set terminal postscript
gnuplot> set output 'gm.ps'
gnuplot> replot
gnuplot> quit
We use a very simple ASCII format for representing polygonal meshes. It consists of a short header, a table of vertex coordinates, and a table of polygons (all triangles) stored as indices into the vertex table.
OFF
Nv Nf 0
x[0] y[0] z[0]
...
x[Nv-1] y[Nv-1] z[Nv-1]
3 i0[0] i1[0] i2[0]
...
3 i0[Nf-1] i1[Nf-1] i2[Nf-1]
Models for assignment 7 :