PDA

View Full Version : OT: stripifying grids



Julien Cayzac
07-30-2002, 11:33 PM
Hi,

Is there a simple straightforward method for stripifying non-uniform planar "grids" (although if they're non uniform they're not grids anymore) ?

For interested ones, here is my current stripifier for uniform u_max * v_max grids (index for the vertex at u,v is u+v*(u_max+1)):




uint16 x,y;
x = u_max+1;
y = 2*x;
for (uint16 index=0; index<y*v_max; index++) {
uint16 u,v;
u = (index/2)%y;
if (u<x) u = t;
else u=(y-1)-u;
v = (index/y);
if ((index%2!=0 &amp;&amp; v%2==0) &amp;#0124; &amp;#0124; (index%2==0 &amp;&amp; v%2!=0)) v++;
stripIndices[index] = v*x + u;
}


Julien.