Today, using the thread in Cuda block to modify the hexahedral of two for loops has been wrong.
// For (int i= 0;i<boxpointnums-1;i++)// { int j= threadidx.x; int i= threadidx.y; // For (int j = 0; j<boxpointnums-1;j++) {
Is that the incorrect sequence of I and J affects the coordinate position when calculating vertex coordinates:
Boxverticescuda[gridindexnumstop]. Pos,-boxlength/2+widthblock*j, Boxtopy, (Boxlength/2-lengthblock*i));
The Thread.x Thread.y in the block, the execution sequence should be the opposite of the For loop , resulting in the final drawing error. It is mostly just beginning with a for ... for draw, which causes the row and column order to be fixed, after being modified to Cuda, a row and column matching is required. If it is Cuda drawn, in for...for may not.
The source code, such as 2015,5,1,
CUDA + DX10 Note: The form of the block internal thread matrix