/* main.c */ #include "ray.h" int main( int argc, char *argv[]) { cam_t *cam; model_t *model; /* Load and dump camera data */ cam = cam_init(stdin); assert(cam != NULL); cam_dump(stderr, cam); int x, y; vec_t dir; char buf[20]; while (fscanf(stdin, "%d %d", &x, &y) == 2) { cam_getdir(cam, x, y, &dir); sprintf(buf, "pix (%3d, %3d) - ", x, y); vec_prn(stderr, buf, &dir); } #if 0 /* Load and dump the model */ model = model_init(stdin); model->cam = cam; assert(model != NULL); model_dump(stderr, model); /* Raytrace the image */ image_create(model); #endif return(0); }