--- ray/src/ot/obj2mesh.c 2004/04/22 17:33:48 2.9 +++ ray/src/ot/obj2mesh.c 2007/07/12 14:58:53 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: obj2mesh.c,v 2.9 2004/04/22 17:33:48 greg Exp $"; +static const char RCSid[] = "$Id: obj2mesh.c,v 2.12 2007/07/12 14:58:53 greg Exp $"; #endif /* * Main program to compile a Wavefront .OBJ file into a Radiance mesh @@ -22,7 +22,7 @@ char *progname; /* argv[0] */ int nowarn = 0; /* supress warnings? */ -int objlim = 15; /* # of objects before split */ +int objlim = 9; /* # of objects before split */ int resolu = 16384; /* octree resolution limit */ @@ -39,7 +39,10 @@ main( /* compile a .OBJ file into a mesh */ ) { int nmatf = 0; - char *matinp[32]; + char pathnames[12800]; + char *pns = pathnames; + char *matinp[128]; + char *cp; int i, j; progname = argv[0]; @@ -56,6 +59,18 @@ main( /* compile a .OBJ file into a mesh */ case 'a': /* material file */ matinp[nmatf++] = argv[++i]; break; + case 'l': /* library material */ + cp = getpath(argv[++i], getrlibpath(), R_OK); + if (cp == NULL) { + sprintf(errmsg, + "cannot find library material: '%s'", + argv[i]); + error(USER, errmsg); + } + matinp[nmatf++] = strcpy(pns, cp); + while (*pns++) + ; + break; case 'w': /* supress warnings */ nowarn = 1; break; @@ -206,7 +221,7 @@ add2full( /* add object to full node */ objset(oset, cu->cutree); cukid.cusize = cu->cusize * 0.5; - if (inc==O_IN || oset[0] < objlim || cukid.cusize < + if (oset[0] < objlim || cukid.cusize < (oset[0] < MAXSET ? mincusize : mincusize/256.0)) { /* add to set */ if (oset[0] >= MAXSET) {