typedef struct{double x, y, z;}t_3d; typedef struct{ t_3d nrm; double d; }o_plane; typedef struct{ double r; /* radius */ double x, y, z; /* center */ }o_sphere; typedef struct{ int sidehit; /* side intersected */ double xs, ys, zs; /* size of sides */ double x, y, z; /* center */ }o_box; typedef struct{ t_3d nrm; /* normal */ double d; /* plane constant */ t_3d e1, e2, e3; /* edge vectors */ double d1, d2, d3; /* plane constants */ }o_triangle; typedef struct{ int sidehit; /* side intersected */ double xs, ys, zs; /* size of sides */ double x, y, z; /* center */ double pow; /* n in formula */ double a, b, c, r; /* coefficients */ double err; /* error measure */ }o_superq; typedef struct{ int id; int objtyp; int surfnum; union{ o_sphere *p_sphere; o_box *p_box; o_triangle *p_triangle; o_superq *p_superq; }objptr; }t_object; typedef struct{double x, y, z, bright;}t_light; typedef struct{ double ar, ag, ab; /* ambient color */ double dr, dg, db; /* diffuse color */ double sr, sg, sb; /* specular color */ double coef; /* specular coefficient */ double refl; /* reflectivity 0-1 */ double tranp; /* transparency 0-1 */ }t_surface; typedef struct{double r, g, b;}t_color;