
8.3 Creating Meshes 227
polygons are to be displayed in a right-handed coordinate system, the vertices are
specified in a counterclockwise order. This also ensures that the normals point in the
correct direction.
polyConnects.append( linearlndex( zeni, azi,
nZenithPts, nAzimuthPts ) );
polyConnects.append( linearlndex( zeni, azi+l,
nZenithPts, nAzimuthPts ) );
polyConnects.append( linearlndex( zeni+l, azi+l,
nZenithPts, nAzimuthPts ) );
polyConnects.append( linearlndex( zeni+l, azi,
nZenithPts, nAzimuthPts ) );
The
genRod
function generates the mesh data for a cylinder that has its main axis
running