CS121 Project 2

Input Format



The input file for Triangle World is in ascii and describes the triangles in your scene as follows:

N
x0   y0   z0   r0   g0   b0
x1   y1   z1   r1   g1   b1
...
xN-1   yN-1   zN-1   rN-1   gN-1   bN-1
M
u0   v0   w0
u1   v1   w1
...
uM-1   vM-1   wM-1


where N is the number of vertices, M is the number of triangles, xi, yi, zi are floats representing the coordinates of vertex i, ri, gi, bi is the color of vertex i, and uj, vj, wj are integers representing indices in the vertex list of the vertices in triangle j as they appear from the front of the triangle in counter-clockwise order.

The following file models a 1x1 red rectangle in the x-y plane facing the positive-z direction with a corner at the origin.
4
0 0 0 1 0 0
1 0 0 1 0 0
1 1 0 1 0 0
0 1 0 1 0 0
2
0 1 2
0 2 3