1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
double dx, dy, dz, dX, dY, dZ;
int bx, by, bX, bY;
for ( i = 0; i < model->qLength; i++ )
{
for ( j = 0; j < 4; j++ )
{
if ( j == 3 )
{
dx = virQuadArr[i].pointArr[3].x;
dy = virQuadArr[i].pointArr[3].y;
dz = virQuadArr[i].pointArr[3].z;
bx = ( eZ / dz ) * dx - eX;
by = ( eZ / dz ) * dy - eY;
dX = virQuadArr[i].pointArr[0].x;
dY = virQuadArr[i].pointArr[0].y;
dZ = virQuadArr[i].pointArr[0].z;
bX = ( eZ / dZ ) * dX - eX;
bY = ( eZ / dZ ) * dY - eY;
drawLine ( bx, by, bX, bY, surface, 0xFF0000 );
}
else
{
dx = virQuadArr[i].pointArr[j].x;
dy = virQuadArr[i].pointArr[j].y;
dz = virQuadArr[i].pointArr[j].z;
bx = ( eZ / dz ) * dx - eX;
by = ( eZ / dz ) * dy - eY;
dX = virQuadArr[i].pointArr[j + 1].x;
dY = virQuadArr[i].pointArr[j + 1].y;
dZ = virQuadArr[i].pointArr[j + 1].z;
bX = ( eZ / dZ ) * dX - eX;
bY = ( eZ / dZ ) * dY - eY;
drawLine ( bx, by, bX, bY, surface, 0x0000FF );
}
}
}
|