QuadFace .02b Readme by Grimani <grimani@annihilationfactory.com>

Introduction

Since the advent of 3rd party utilities for hacking and creation
of Total Annihilation units, many people have tried to model their 
own units.  I was no exception.  However, Rhino3d didn't suit me,
since I was already used to the 3d Studio Max interface.  That was 
fine, I thought I'd use Max and export to DXF.  

Ooops.  Maybe I'm dumb, but it's seem like I overlooked one small 
thing:  although quad faces were displayed in Max, exported files 
were all tri faces.  Why?  Max uses tri faces internally, and I guess 
it was simply easier to just export tri faces. When I imported these 
tri faced models into 3do Builder, they didn't look pretty. Texturing 
them became a pain, and the units made from these 'split' DXFs had
ugly wireframes.  

After searching for answers everywhere, I finally decided to write 
a utility that did this on my own.  I had done a bit of research 
one the DXF file format when I used Soap, because the four lines it
would rip out of each file sounded suspicious... It turns out that
Soap did not rip out any useful information from the DXFs, contrary
to what I believed.  Oops.  

The four lines that Soap rips out do two things:  name the face, and 
give it a color.  Since these aren't use in 3do builder, QuadFace 
strips them from the DXF too.  Also, the extra 3DFACE that both Soap
AND MBCLEAN add (both differently) don't seem to be in the right 
format.  I don't know if it matters, but QuadFace exports a quad with
all vertices at (0,0,0).  

So yesterday (7/15/98), I started a new project in MSVC, and began work
on a 'triface merger program'.  Towards the beginning of the project
I wanted QuadFace to have a nice, neat structure, so I made a bunch of
classes, member functions, private variables...OOP stuff.  Later on in
the night, fatigue set in, so I ditched the OOP and just made the rest
of QuadFace procedural.  Dawn found me clunking at the keyboard thru
half opened eyes, and being the mindless zombie that I was, I ditched
pointers and loops, and unrolled everything I wanted QuadFace to do.  
Not long after I fell asleep ;).  (you gotta be a programmer to get 
that ;).  Anyway, as you can tell, my source code is a bit of a mess;
it contains part of old buggy file i/o code ripped from some graphics
library I wrote a while back, and is very very obfuscated...so don't 
ask for it until I clean it up.

I finished the program today with a bit of algo help from _DR_ and QQ 
of #C on EFnet, and after a bit of debugging, here I am writing the
damn readme.  

Easy Instructions

1 Export your model in DXF format from Max
2 Convert it with another program so the DXF uses 3DFACE
      Rhino3d, Crossroads, wcvt2pov all do this. 
      Get Crossroads at (http://www.europa.com/~keithr/)
3 Edit BATCH.TXT which is included with QuadFace.  Make sure that there
      are NO spaces or lines after the last letter you type.  Press
      delete a few times to make sure.
4 Type QuadFace -a BATCH.TXT
5 Cross your fingers, and load up 3do Builder.  :)

How To Use QuadFace

SYNTAX:

quadface.exe <-a> <batchfile>

Switches:
-a			Append extra 3DFACE

<batchfile>		Batchfile containing list of files to process

The batchfile must be of the following format:

<exportedfile#1>
<processedfile#1>
<exportedfile#2>
<processedfile#2>
<exportedfile#3>
...
...

IMPORTANT:  Make sure there are no extra spaces or lines after the last
letter in the extension of the last filename.  If QuadFace crashes, 
this is probably the reason.  Too tired to fix it right now.

What QuadFace Does

QuadFace basically does this:

Open a file for reading
Open a file for writing
Read in two 4 point 3dfaces (4th point is repeat of 3rd)
Discard 4th point (dunno why I wasted my time with this...)
Find the union of the two sets of points (becomes 4 point set)
Sort the resulting set (connect the dot kinda thing)
Write rebuilt quad to file
Repeat for all quads
Write extra 3DFACE
Close both files
Repeat for all files

What QuadFace Taught Me

A LOT of respect for Kinboat, Rhad, and all the other 3d programmers out
there who've done free utilities.  I almost went crazy over a simple utility
like this one...can you imagine what's needed to implement rotation,
translation, scaling, and all the other crap we want in 3do builder?  Kudos
to them :)

I gotta pay attention in math class.  I spent a lot of my time trying
to figure out how to sort 3d points into the order that I'd draw them
if I were connecting the dots (must save in that order in DXF).  
Finding the union of the two sets wasn't easy either.  Maybe I'll learn
stuff like this in Precalculus next year :).


Future Fixes for QuadFace

-Port to Win32/MFC.  (Why not?  I'm learning MFC right now ;)
-Fix some file i/o bugs
-Better conversion (it's really still a hack right now)

Where To Get QuadFace

Where else?  ANNIHILATION FACTORY ;).
www.annihilationfactory.com - Your #1 Total Annihilation Source :)!!

How To Contact Me

grimani@annihilationfactory.com

Thanks To
Gin'n'Juice!!! We're gonna make a huge entrance what we're working on ;)
_DR_ and QQ from #C on EFnet
All the 3rd party utility programmers...good job guys!
Raptor and the rest of Annihilation Factory
Those on the TADD discussion forum
Marc Duller - bug testing
Everyone else, too :):):) (Note the liberal use of :)'s?  I can go to 
sleep!)
