/*----------------geom.c-----------------*/ void perspective (Celem cam, Vert *p); void multimat (APos *p, Matrix m, APos o); double innerproduct (APos p0, APos p1, APos p2); double outerproduct (APos *n, APos p0, APos p1, APos p2); double patchnormal (APos *n, APos p0, APos p1, APos p2); double dirunit (APos d, APos q, APos p); double vecunit (APos v); double edgelength (APos p, APos q); /*----------------misc.c-----------------*/ void init_oelem (Oelem *oelem); /*----------------ppmlib.c-----------------*/ int write_ppm (ImgBuf ppm, char *ppmfile); int write_pix_z (int x, int y, double z, ACol dc, ImgBuf ppm); int write_pix_d (int x, int y, ACol dc, ImgBuf ppm); /*----------------raster.c-----------------*/ void sort_tri (Vert *p0, Vert *p1, Vert *p2); int shade_tri (Vert p0, Vert p1, Vert p2, Oelem oelem, Lelem *lelem, int n_lelem, Celem cam, ImgBuf ppm); void shading_color (ACol dc, APos p0, APos p1, APos p2, APos n, Lelem *lelem, int n_lelem, Oelem oelem, Celem celem); void color_diffuse (ACol dc, APos n, ACol l_int, APos ilv, Oelem oelem); void color_specula (ACol dc, APos n, ACol l_int, APos ilv, APos cdv, Oelem oelem); void color_ambient (ACol dc, ACol l_int, Oelem oelem); double attenuation (double len); /*----------------vrml.c-----------------*/ int read_one_obj (FILE *fd, Oelem *oelem, Selem *selem);