[comp.graphics] Wanted, 3d matrix multiplication source code for IBM PC

Bobster@cup.portal.com (Robert Jules Shaughnessy) (04/01/91)

     I am looking for assembler source code for MS-DOS/PC Clone, that
will perform 3D matrix multiplication X,Y,Z rotation. If you have some
source code that contains this, could you please send it to me? Also I
would really like to have a perspective routine in ASM as well.
(Central projection when the projection center lies on the Z axis and
the Projection plane is at z=0 is preferable. However I will be very
glad to look at ANYTHING!)


Thanks in advance!!!

Bobby Shaughnessy
 

lance@motcsd.csd.mot.com (lance.norskog) (04/17/91)

In article <40747@cup.portal.com> Bobster@cup.portal.com (Robert Jules Shaughnessy) writes:
>
>     I am looking for assembler source code for MS-DOS/PC Clone, that
>will perform 3D matrix multiplication X,Y,Z rotation. If you have some
> [rest deleted]
>Bobby Shaughnessy
> 

Well, you could toss your Intel 8x87 and buy an IIT 8x87 clone.  It
has a very spiffy 4x4 matmul routine which is much faster if you're
processing many points in a row through one matrix.  It has special
extra registers for storing the matrix.  

Another method: push the 3 numbers of your input point into the 87
stack.  Then, to process the first two lines of the matrix, copy
a register in the stack to the top of the stack (there's an instruction
for this).  The point here is to avoid loading the same point into
the chip 3 times.

If you're matmul-ing a point, then using it, then throwing it away,
you can use fixed-point arithmetic or the integer hacks posted here
before.  But remember, if you're saving the processed point around and
using it a lot, you want it to be accurate.

Lance