Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r979 - trunk/Model/Groups
- Date: Tue, 7 Mar 2006 17:18:09 -0700 (MST)
Author: bigler
Date: Tue Mar 7 17:18:08 2006
New Revision: 979
Modified:
trunk/Model/Groups/KDTreeLoaderIW.cc
Log:
Added some info on the file format.
Close the files when done with them.
Modified: trunk/Model/Groups/KDTreeLoaderIW.cc
==============================================================================
--- trunk/Model/Groups/KDTreeLoaderIW.cc (original)
+++ trunk/Model/Groups/KDTreeLoaderIW.cc Tue Mar 7 17:18:08 2006
@@ -33,6 +33,58 @@
using namespace Manta;
using namespace Kdtree;
+/* This is the text that Ingo gave me on the file format
+
+the iw-file looks like
+
+newobject 0
+vertices: <numvertices>
+\tx y z
+\tx y z
+... ("numvertices" times, that's the vertex positions)
+vtxnormals: <numvertices>
+\tnx ny nz
+\tnx ny nz
+...
+triangles: <numtriangles>
+\ta b c s
+\ta b c s
+... // each triangle consists of vertex ID's a, b, and c ('0' is
+the first vertex from 'vertices' above);
+'s' is the shader ID (ignore for this test)
+
+at the end there's some shader information; just ignore it.
+
+
+the .bsp-file is defiend recursively:
+
+each line is one bsp node;
+
+at the beginning of the line there's some whitespaces; just skip over them.
+
+the first non-whitespace char says whether the node is an inner node ("N"),
+or a leaf node ("L").
+
+A leaf node will look like "L <numitemsinleaf> <item0> <item1> ....";
+where each 'item' is the ID (i.e., an int) of the tri refrenced in that
+leaf (tri '0' is the first one).
+
+A inner node will look like
+'"N %c=%f,d=%i",&uchar_axis_dim,&float_axis_pos, &int_depth", and will
+by its two subtrees.
+
+the axis_dim is 'x', 'y', or 'z', the depth can be ignored
+(debugging purposes only).
+
+Should be pretty easy to parse, I hope....
+
+Ciao
+
+Ingo
+
+*/
+
+
// Load the specified file (and associated kdtree files) using the
// given number of processors. The geometry should be found in
// geom_filename and the bsp data should be found in bsp_filename.
@@ -141,13 +193,18 @@
t.payload = all_color;
}
- fprintf(stderr, "vertices :%20u\n", num_vertices);
- fprintf(stderr, "vertex normals:%20u\n", num_vtxnormals);
- fprintf(stderr, "triangles :%20u\n", num_tris);
+ fprintf(stderr, "vertices :%10u\n", num_vertices);
+ fprintf(stderr, "vertex normals :%10u\n", num_vtxnormals);
+ fprintf(stderr, "triangles :%10u\n", num_tris);
// Cleanup memory
free(vertices);
free(vtxnormals);
+ fclose(geomf);
+
+ // Load in the BSP stuff
+
+ fclose(bspf);
} // int loadIW()
- [MANTA] r979 - trunk/Model/Groups, bigler, 03/07/2006
Archive powered by MHonArc 2.6.16.