/* material.c */ #include "ray.h" void material_load_attributes( FILE *in, material_t *mats) { /* Use same basic approach as camera_load_attributes() */ ------------ } /**/ /* Create a new material description */ void material_init( FILE *in, model_t *model, int attrmax) // ignore { material_t *mat; /* malloc() a material_t structure, use memset() to */ /* initialize it to 0 and store the MAT_COOKIE */ ------------ /* Load attributes as in camera.c */ /* Unlike the camera the number of attributes is */ /* optional. Attributes should be initialized to 0.0 */ material_load_attributes(in, mat); /* Ask list_add to add the material entity to the end */ /* of the mats list in the model structure. */ --------- } material_t *material_getbyname( model_t *model, char *name) // requested material name (e.g. yellow) { material_t *mat; ------------ } static inline void material_print( material_t *mat, FILE *out) { assert(mat->cookie == MAT_COOKIE); ------------- } /**/ /* Produce a formatted dump of the material list */ void material_list_print( model_t *model, FILE *out) { ------------- } void material_getambient( material_t *mat, drgb_t dest) /* fill in ambient reflectivity here */ { ----- }