summaryrefslogtreecommitdiff
path: root/libobj/obj.2.man
diff options
context:
space:
mode:
authorrgl <devnull@localhost>2020-02-03 22:42:28 +0100
committerrgl <devnull@localhost>2020-02-03 22:42:28 +0100
commit0373255087377122eeb10e006ffb8aa1b57e611c (patch)
tree33a4fafa4996fc2efa205b2973622c3fbd27f368 /libobj/obj.2.man
download3dee-0373255087377122eeb10e006ffb8aa1b57e611c.tar.gz
3dee-0373255087377122eeb10e006ffb8aa1b57e611c.tar.bz2
3dee-0373255087377122eeb10e006ffb8aa1b57e611c.zip
after a year or so of work, i dare create a proper repo.
Diffstat (limited to 'libobj/obj.2.man')
-rw-r--r--libobj/obj.2.man88
1 files changed, 88 insertions, 0 deletions
diff --git a/libobj/obj.2.man b/libobj/obj.2.man
new file mode 100644
index 0000000..9196385
--- /dev/null
+++ b/libobj/obj.2.man
@@ -0,0 +1,88 @@
+.TH OBJ 2
+.SH NAME
+objparse,
+objfree,
+OBJfmt,
+OBJfmtinstall
+\- OBJ parser
+.SH SYNOPSIS
+.ta 0.7i +0.7i +0.7i +0.7i +0.7i +0.7i +0.7i
+.EX
+#include <u.h>
+#include <libc.h>
+#include <obj.h>
+
+enum {
+ OBJVGeometric,
+ OBJVTexture,
+ OBJVNormal,
+ OBJVParametric,
+ OBJNVERT
+};
+
+enum {
+ OBJEPoint,
+ OBJELine,
+ OBJEFace,
+ OBJECurve,
+ OBJECurve2,
+ OBJESurface
+};
+
+enum {
+ OBJHTSIZE = 17
+};
+
+typedef struct
+{
+ union {
+ struct { double x, y, z, w; }; /* geometric */
+ struct { double u, v, vv; }; /* texture and parametric */
+ struct { double i, j, k; }; /* normal */
+ };
+} OBJVertex;
+
+typedef struct
+{
+ OBJVertex *verts;
+ int nvert;
+} OBJVertexArray;
+
+typedef struct
+{
+ int *indices;
+ int nindex;
+ int type;
+ OBJElem *next;
+} OBJElem;
+
+typedef struct
+{
+ char *name;
+ OBJElem *child;
+ OBJObject *next;
+} OBJObject;
+
+typedef struct
+{
+ OBJVertexArray vertdata[OBJNVERT];
+ OBJObject *objtab[OBJHTSIZE];
+} OBJ;
+
+OBJ *objparse(char *file);
+void objfree(OBJ *obj);
+int OBJfmt(Fmt*);
+void OBJfmtinstall(void);
+.EE
+.SH DESCRIPTION
+An OBJ structure contains geometry and material information about a set of 3D objects
+.SH SOURCE
+.B /sys/src/libobj
+.SH SEE ALSO
+.IR geometry (2)
+.br
+http://paulbourke.net/dataformats/obj
+.br
+https://people.sc.fsu.edu/~jburkardt/data/obj/obj.html
+.SH DIAGNOSTICS
+.SH BUGS