diff --git a/solidify/povray.c b/solidify/povray.c index ac8e70a..4b42663 100644 --- a/solidify/povray.c +++ b/solidify/povray.c @@ -100,7 +100,7 @@ static void povray_face(const struct face *f, const char *side, "\t}\n", prefix, side, f->sx*f->x_step, (f->sz-1)*f->z_step, f->sy*f->y_step, -f->sx*f->x_step/2, f->sy*f->y_step/2, - -atan(f->fy)/M_PI*180, -atan(f->fx)/M_PI*180, + -atan(f->fy)/M_PI*180, atan(f->fx)/M_PI*180, f->a->min_z*f->z_step, -f->z_ref*f->z_step, a, diff --git a/solidify/project.c b/solidify/project.c index 7d14625..28a4582 100644 --- a/solidify/project.c +++ b/solidify/project.c @@ -72,7 +72,7 @@ static void read_face_data(FILE *file, struct face *f) if (fscanf(file, "%f", &v) != 1) return; - f->fx = tan(v/180*M_PI); + f->fx = -tan(v/180*M_PI); if (fscanf(file, "%f", &v) != 1) return; @@ -163,7 +163,7 @@ static void save_face_data(FILE *file, const char *name, const struct face *f) a = 180-a; if (fprintf(file, "%g %g %g\n%g %g %g\n", f->z_ref*f->z_step, - atan(f->fx)/M_PI*180, atan(f->fy)/M_PI*180, + -atan(f->fx)/M_PI*180, atan(f->fy)/M_PI*180, a, f->m.b[0]*f->x_step, f->m.b[1]*f->y_step) < 0) { perror(name); exit(1);