12.7 Parametric Subdivision 603
for(x=0;x+y<=N;x++)
{
u = x/N;
vertex[k++] = X(u,v); // evaluation of triangle patch
}
}
// Compute the triangle connectivity.
t=0;
ystart = 0;
for(y=0;y<N;y++)
{
k0 = ystart;
k1=k0+1;
ystart = (y + 1) * (2 * (N + 1) - y)/2;
k2 = ystart;
for(x=0;x+y<N;x++)
{
connectivity[t++] = k0;
connectivity[t++] = k1;
connectivity[t++] = k2;
if(x+y+1<N)
{
connectivity[t++] = k1;
connectivity[t++] = k2 + 1;
connectivity[t++] = k2;
}
k0++;
k1++;
k2++;
}
}
Nonuniform Subdivision
Like the algorithm of Lindstrom et al. (1996), the following algorithm is based on the
ideas in [LKR
+
96]; it uses the equivalent of a symmetric triangulation for quadtree
blocks and has a vertex dependency structure.
Consider a single triangle whose vertices are labeled as top T ,le