Preliminary source code for tri-stripper

ANSI C (I think) source code implementing the triangle stripper module is available now as a Gzipped tar archive. The source and sample data sets will unpack into a directory named meshifier .

If you have any questions or problems or find any bugs, please send me some mail.

Without further ado, here's the HTML-enhanced README.


The test program should compile in an ANSI environment like this:

	cc -O main.c mesh.c -o mesh

You could easily make a library, but since the meshifier is in one
file, that wouldn't help you link any faster.

Directory contents:
    mesh.c		- Meshifier module code
    mesh.h		- Meshifier module header
    main.c		- VERY simple sample application, but it uses
			    my graphics library which I haven't released.
			    Look for an OpenGL test program soon.
    randlines.c		- a simple line randomizer for scrambling input
			    data (cc randlines.c -o randlines)
    data1
    data2
    data3		- sample data files from one patch of the Utah
    			    teapot.

Poor man's man page:

    meshReset()		- reset arrays, internal data structures, and whatever
    meshAddVertex()	- add a new vertex.  Finish adding vertices before
    			    adding any triangles.
    meshAddTriangle()	- add a new triangle.  The parameters are indices
    			    into the vertex list for each vertex in the
			    triangle.
    meshSetProcs()	- set the functions that will draw your data.  The
     			    only really important ones are the begin,
			    continue, and end strip functions.  The others
			    can be set to NULL if you're not going to enable
			    outline output or connectivity graphics.
    meshCreateStrips()	- go and create the strips.  Use the procs from
    			    meshSetProcs() to output the finished strips.

    meshSetFlag()	- set some behavior of the program.
        MESH_DRAWSTRIPOUTLINES	- draw lines around each strip
        MESH_DRAWCONNECTIVITY	- draw lines and text indicating the triangle
				    connectivity that the meshifier finds.
	MESH_PRINTSTRIPCONTENTS - print the strip contents as indices into
				    the triangle list
	MESH_PRINTADDTRIANGLES  - print each triangle index as it's inserted
				    into a strip.  Only really useful as a
				    progress indicator.


Future directions:
	OpenGL test program (so everyone can test it if they compile Mesa).
	Functionality to take an arbitrary triangle list, with float[3]s
	    for the vertices and generate the vertex and triangle lists.
	    This would make the code much more useful.
	Clean up the cruft.


Let me know if you have any questions or trouble or find any bugs.
This tar file can probably be found at my web page.


Brad Grantham, grantham@plunk.org, http://plunk.org/~grantham/


Brad Grantham

grantham@plunk.org
( This page was last changed Thu Feb 14 15:29:10 EST 2002 )