From: Dave Stampe-Psy+Eng <[email-masked]>
Date: Thu, 9 Jan 92 23:50:22 -0500

Subject: Re:  3d graphics question

Well, we hope to soon have sci.virtual-worlds.tech.  

The way to get the formulas for the 9 multiplies is to create a 3x3
matrix for EACH of the 3 awes rotations, then multiply them.  You 
still have only 9 coefficients, so you only need 9 multiplies.
I have it all figured, and Bernie Roehl has got the method going.
I hope to be able to post sample code soon.

As to clipping, it isn't that expensive.  If you have 32-bit coords in
your world (1mm resolution gives you 16.7 km world size if you use
24 bits) you'll get at least that much size after you transform
the coordinates.  And you must clip so Z stays positive, or stuff
behind/beside you will fold over on the screen (yechh).

Polys: a lot of people use triangles because it looks simple, but
4-sided polys can cut your poly count in half.  However, once you
start to clip polys to fit the screen, you need more sides (up
to 5 more if you clip to hither (near Z) and the 4 screen sides.
So to use triangles, you must split the poly into 2 for EACH
new side added.  

Of course, for wireframe you just clip the lines to fit the screen,
and don't draw them at all if they don't fit the screen.  I have
an assembly (16-bit coordinates) Cohen-Sutherland clipper that
takes less than 6 uS to clip a line (and 1 uS if it can be thrown
out or doesn't need clipping).  BUT you must keep track of what lines have been drawn, or you'll end up drawing all lines twice.  So you now have 
to represent the edges (which can be shared by 2 polygons) in your
decription of objects as well.

- Dave Stampe