#include #include #include typedef struct point { double x,y,z; } POINT; typedef struct ray { POINT p,v; } RAY; typedef struct polygon { int n; POINT *v; } POLYGON; RAY *make_ray(POINT eye, int n, int x, int y); POINT *ray_poly_intersect(RAY *ray, POLYGON *polygon); main () { RAY *ray; POLYGON poly; POINT eye,*hitpoint; int i,x,y; int n; scanf("%lf%lf%lf",&eye.x,&eye.y,&eye.z); scanf("%d",&n); scanf("%d%d",&x,&y); scanf("%d",&poly.n); poly.v = (POINT *)malloc(poly.n*sizeof(POINT)); for (i=0; ix,hitpoint->y,hitpoint->z); } /* * You must change these functions to do the right thing */ RAY *make_ray(POINT eye, int n, int x, int y) { RAY *ray = (RAY *)malloc(sizeof(RAY)); /* * These are arbitrary values. * You'll have to set all of them correctly yourself. */ ray->p.x = 0.0; ray->p.y = 0.0; ray->p.z = 0.0; ray->v.x = 0.0; ray->v.y = 0.0; ray->v.z = 1.0; return ray; } POINT *ray_poly_intersect(RAY *ray, POLYGON *polygon) { return NULL; }