Back to index

radiance  4R0+20100331
Functions | Variables
mat4.c File Reference
#include "copyright.h"
#include "mat4.h"

Go to the source code of this file.

Functions

void multmat4 (MAT4 m4a, MAT4 m4b, MAT4 m4c)
void multv3 (FVECT v3a, FVECT v3b, MAT4 m4)
void multp3 (FVECT p3a, FVECT p3b, MAT4 m4)

Variables

static const char RCSid [] = "$Id: mat4.c,v 2.4 2003/02/25 02:47:21 greg Exp $"
MAT4 m4ident = MAT4IDENT
static MAT4 m4tmp

Function Documentation

void multmat4 ( MAT4  m4a,
MAT4  m4b,
MAT4  m4c 
)

Definition at line 18 of file mat4.c.

{
       register int  i, j;
       
       for (i = 4; i--; )
              for (j = 4; j--; )
                     m4tmp[i][j] = m4b[i][0]*m4c[0][j] +
                                  m4b[i][1]*m4c[1][j] +
                                  m4b[i][2]*m4c[2][j] +
                                  m4b[i][3]*m4c[3][j];
       
       copymat4(m4a, m4tmp);
}

Here is the caller graph for this function:

void multp3 ( FVECT  p3a,
FVECT  p3b,
MAT4  m4 
)

Definition at line 52 of file mat4.c.

{
       multv3(p3a, p3b, m4);       /* transform as vector */
       p3a[0] += m4[3][0];  /* translate */
       p3a[1] += m4[3][1];
       p3a[2] += m4[3][2];
}

Here is the caller graph for this function:

void multv3 ( FVECT  v3a,
FVECT  v3b,
MAT4  m4 
)

Definition at line 36 of file mat4.c.

{
       m4tmp[0][0] = v3b[0]*m4[0][0] + v3b[1]*m4[1][0] + v3b[2]*m4[2][0];
       m4tmp[0][1] = v3b[0]*m4[0][1] + v3b[1]*m4[1][1] + v3b[2]*m4[2][1];
       m4tmp[0][2] = v3b[0]*m4[0][2] + v3b[1]*m4[1][2] + v3b[2]*m4[2][2];
       
       v3a[0] = m4tmp[0][0];
       v3a[1] = m4tmp[0][1];
       v3a[2] = m4tmp[0][2];
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 12 of file mat4.c.

MAT4 m4tmp [static]

Definition at line 14 of file mat4.c.

const char RCSid[] = "$Id: mat4.c,v 2.4 2003/02/25 02:47:21 greg Exp $" [static]

Definition at line 2 of file mat4.c.