diff options
-rwxr-xr-x | .workspace | 1 | ||||
-rw-r--r-- | obj.c | 15 | ||||
-rw-r--r-- | readme | 7 |
3 files changed, 10 insertions, 13 deletions
@@ -1,6 +1,5 @@ #!/bin/rc bind -bc ../libgraphics libgraphics -bind -bc ../libobj libgraphics/libobj bind -bc ../libobj libobj B *.[hc] mkfile readme @@ -325,7 +325,7 @@ readobjmodel(char *path) static void usage(void) { - fprint(2, "usage: %s [file]\n", argv0); + fprint(2, "usage: %s objfile dstdir\n", argv0); exits("usage"); } @@ -333,18 +333,17 @@ void threadmain(int argc, char *argv[]) { Model *m; - char *infile; - infile = "/fd/0"; ARGBEGIN{ default: usage(); }ARGEND; - if(argc == 1) - infile = argv[0]; - else if(argc != 0) + if(argc != 2) usage(); - m = readobjmodel(infile); - writemodel(1, m); + m = readobjmodel(argv[0]); + if(m == nil) + sysfatal("readobjmodel: %r"); + if(exportmodel(argv[1], m) < 0) + sysfatal("exportmodel: %r"); exits(nil); } @@ -94,12 +94,11 @@ USAGE positions. - obj [file] + obj objfile dir - As of now this tool will take a Wavefront OBJ file, with all its materials, + This tool will take a Wavefront OBJ file objfile, with all its materials, and convert it into a model(6) file (see libgraphics/model.6.txt) that's - written to stdout. The only exception is textures, which aren't taken care - of yet. This will change soon. + written, along with its assets, inside the directory dir. CUBEMAPS |