2 hj199241 hj199241 于 2014.07.02 09:39 提问

求三维凸包的程序,读不太懂,不知道应该输入什么

源代码链接:http://www.cise.ufl.edu/class/cap5705fa11/openGL/delauney/dt2.c
先把Main函数和ReadVertices函数代码放上,求指点,输入到底该是什么呢?
main( int argc, char *argv[] )
{

if ( argc > 1 && argv[1][0] == '-' ) {
if( argv[1][1] == 'd' ) {
debug = TRUE;
check = TRUE;
fprintf( stderr, "Debug and check mode\n");
}
if( argv[1][1] == 'c' ) {
check = TRUE;
fprintf( stderr, "Check mode\n");
}
}
else if ( argc > 1 && argv[1][0] != '-' ) {
printf ("Usage: %s -d[ebug] c[heck]\n", *argv );
printf ("x y z coords of vertices from stdin\n");
exit(1);
}

ReadVertices();
DoubleTriangle();
ConstructHull();
EdgeOrderOnFaces();
Print();
}
void ReadVertices( void )
{
tVertex v;
int x, y, z;
int vnum = 0;

while ( scanf ("%d %d %d", &x, &y, &z ) != EOF ) {
v = MakeNullVertex();
v->v[X] = x;
v->v[Y] = y;
v->v[Z] = z;
v->vnum = vnum++;
if ( ( abs(x) > SAFE ) || ( abs(y) > SAFE ) || ( abs(z) > SAFE ) ) {
printf("Coordinate of vertex below might be too large: run with -d flag\n");
PrintPoint(v);
}
}
}
上面是main函数和另外一个读取函数,求大神指点,这个输入到底怎么回事,程序应该是OK的,编译不会发生错误

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!