aboutsummaryrefslogtreecommitdiff
path: root/sunrise.py
blob: 7cde57e36ae3cd4fb898eda21a5d9c602cd571da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import numpy
import matplotlib.pyplot as plt

from firmament import Renderer
from firmament.planets import earth

config = {
    'size_x': 1920//4,
    'size_y': 1080//4,

    'ray_samples'  : 32,
    'light_samples': 8,

    'exposure': 2.0,
    'zoom':     1.0,

    'eye_pos': numpy.array([0, 0, 1.0001]),
    'eye_dir': numpy.array([0, 1, 0])
}

sun_range = (-10, 90, 10)

renderer = Renderer(config, earth)

for i in numpy.arange(*sun_range):
    sun = (0.0, numpy.cos(i*2*numpy.pi/360), numpy.sin(i*2*numpy.pi/360))
    print(sun)

    np_picture = renderer.render_pinhole(sun)

    plt.imsave("sky_%05.1f.png" % (i-sun_range[0]), np_picture, origin='lower')