diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-27 21:04:56 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-27 21:04:56 +0000 |
commit | 1af782b52c796fd341621b0c9de2dea3a1c7c660 (patch) | |
tree | 7060b0ba730fd24ed99e4f6e7669ef8f2af76907 | |
parent | c7f2ba6465d213923e25174db722ca13716ec018 (diff) | |
download | 3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.tar.gz 3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.tar.bz2 3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.zip |
obj: make it right.
-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 |