Back to index

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

Go to the source code of this file.

Functions

void domatobj (MATREC *mp, FVECT cent)
void domatvert (MATREC *mp, FVECT v, FVECT n)

Variables

static const char RCSid [] = "$Id: rgldomat.c,v 3.4 2003/11/14 17:22:06 schorsch Exp $"

Function Documentation

void domatobj ( MATREC mp,
FVECT  cent 
)

Definition at line 14 of file rgldomat.c.

{
       GLfloat       vec[4];

       if ((mp == NULL) | !domats)
              return;
       if (islight(mp->type)) {
              vec[0] = colval(mp->u.l.emission,RED);
              vec[1] = colval(mp->u.l.emission,GRN);
              vec[2] = colval(mp->u.l.emission,BLU);
              vec[3] = 1.;
              glMaterialfv(GL_FRONT, GL_EMISSION, vec);
              vec[0] = vec[1] = vec[2] = 0.; vec[3] = 1.;
              glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, vec);
              glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, vec);
       } else {
              vec[0] = colval(mp->u.m.ambdiff,RED);
              vec[1] = colval(mp->u.m.ambdiff,GRN);
              vec[2] = colval(mp->u.m.ambdiff,BLU);
              vec[3] = 1.;
              glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, vec);
              vec[0] = colval(mp->u.m.specular,RED);
              vec[1] = colval(mp->u.m.specular,GRN);
              vec[2] = colval(mp->u.m.specular,BLU);
              vec[3] = 1.;
              glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, vec);
              glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, mp->u.m.specexp);
              vec[0] = vec[1] = vec[2] = 0.; vec[3] = 1.;
              glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, vec);
       }
       rgl_checkerr("in domatobj");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void domatvert ( MATREC mp,
FVECT  v,
FVECT  n 
)

Definition at line 51 of file rgldomat.c.

{
       /* unimplemented */
}

Variable Documentation

const char RCSid[] = "$Id: rgldomat.c,v 3.4 2003/11/14 17:22:06 schorsch Exp $" [static]

Definition at line 2 of file rgldomat.c.