Cylinder Rotation

A Cylinder is composed by a face list of rectangles. The total number of vertices is (number of segments * 3 *2). The vertices algorithm is:

for every i < # of segments
rotate to get the next point

v[counter] = new top x location;
v[counter+1] = new top y location;
v[counter+2] = new top z location;
v[counter+3] = new bottom x location;
v[counter+4] = new bottom y location;
v[counter+5] = new bottom z location;

counter+=6;

}

The number of faces is the number of segments. The face list algorithm is:

for(i=0; i<(# of segments*2)-1; i+=2){
if (i == # of segments*2-2)
face[i/2] = face list of pts (j,j+1,1,0);
else
face[i/2] = face list of pts (j,j+1, j+3,j+2);
}