[julia] change how azimuth is chosen for lighting

Use a vector that has always a z-coordinate in (0,1) range.
This commit is contained in:
Lucas 2020-03-13 01:33:12 +00:00
parent 82a83dafbe
commit 5078ef1578

View File

@ -203,7 +203,10 @@ julia_main(int argc, char *argv[])
if (do_light) { if (do_light) {
long double angle_xy, angle_z; long double angle_xy, angle_z;
angle_xy = drand48() * 2.0L * RADIAN; angle_xy = drand48() * 2.0L * RADIAN;
angle_z = (0.2L + 0.6L * drand48()) * RADIAN; do
angle_z = drand48();
while (angle_z == 0.0L || angle_z == 1.0L);
angle_z = angle_z * 0.5L * RADIAN;
light_x = cosl(angle_xy) * sinl(angle_z); light_x = cosl(angle_xy) * sinl(angle_z);
light_y = sinl(angle_xy) * sinl(angle_z); light_y = sinl(angle_xy) * sinl(angle_z);
light_z = cosl(angle_z); light_z = cosl(angle_z);