summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-09-27 21:04:56 +0000
committerrodri <rgl@antares-labs.eu>2024-09-27 21:04:56 +0000
commit1af782b52c796fd341621b0c9de2dea3a1c7c660 (patch)
tree7060b0ba730fd24ed99e4f6e7669ef8f2af76907
parentc7f2ba6465d213923e25174db722ca13716ec018 (diff)
download3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.tar.gz
3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.tar.bz2
3dee-1af782b52c796fd341621b0c9de2dea3a1c7c660.zip
obj: make it right.
-rwxr-xr-x.workspace1
-rw-r--r--obj.c15
-rw-r--r--readme7
3 files changed, 10 insertions, 13 deletions
diff --git a/.workspace b/.workspace
index c39eb66..4ef2181 100755
--- a/.workspace
+++ b/.workspace
@@ -1,6 +1,5 @@
#!/bin/rc
bind -bc ../libgraphics libgraphics
-bind -bc ../libobj libgraphics/libobj
bind -bc ../libobj libobj
B *.[hc] mkfile readme
diff --git a/obj.c b/obj.c
index 9f296a2..a2e5936 100644
--- a/obj.c
+++ b/obj.c
@@ -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);
}
diff --git a/readme b/readme
index 8a62116..a888d60 100644
--- a/readme
+++ b/readme
@@ -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