aboutsummaryrefslogtreecommitdiff
path: root/bluedot.py
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-01-03 14:09:40 +0100
committerAdrian Kummerlaender2020-01-03 18:34:18 +0100
commit51d4f8162df01225e096d24971e8c8335b8c8371 (patch)
tree102337be14a1bdcfb7054aa88a3f3b0f2ac1bcd1 /bluedot.py
parent923ad5e83be561dcadfec113177cd7cbcaea56d9 (diff)
downloadfirmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar.gz
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar.bz2
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar.lz
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar.xz
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.tar.zst
firmament-51d4f8162df01225e096d24971e8c8335b8c8371.zip
Improve structure, play around with phase functions
Diffstat (limited to 'bluedot.py')
-rw-r--r--bluedot.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/bluedot.py b/bluedot.py
index 036ae7f..4b906a8 100644
--- a/bluedot.py
+++ b/bluedot.py
@@ -17,11 +17,14 @@ config = {
'light_samples': 8,
'exposure': 20.0,
+ 'zoom': 2.0,
- 'eye_pos': (0, -3, 1.1),
- 'eye_dir': (0, 1, -0.35)
+ 'eye_pos': numpy.array([0, -3, 1.1]),
+ 'eye_dir': numpy.array([0, 1, -0.35])
}
+sun_range = (0, 360, 1)
+
cl_platform = cl.get_platforms()[0]
cl_context = cl.Context(properties=[(cl.context_properties.PLATFORM, cl_platform)])
cl_queue = cl.CommandQueue(cl_context)
@@ -34,17 +37,17 @@ with open('raymarch.cl') as f:
{**config, **earth}
)).build()
-for i in range(0,360):
+for i in numpy.arange(*sun_range):
sun = make_double3(numpy.cos(i*2*numpy.pi/360),numpy.sin(i*2*numpy.pi/360),0)
print(sun)
program.render(
cl_queue, (config['size_x'], config['size_y']), None, cl_picture,
- make_double3(*config['eye_pos']),
- make_double3(*config['eye_dir']),
+ make_double3(*(config['eye_pos'] * earth['earth_radius'])),
+ make_double3(*(config['eye_dir'] * earth['earth_radius'])),
sun)
np_picture = numpy.ndarray(shape=(config['size_y'], config['size_x'], 3), dtype=numpy.float64)
cl.enqueue_copy(cl_queue, np_picture, cl_picture).wait();
- plt.imsave('sky_%03d.png' % i, np_picture, origin='lower')
+ plt.imsave("bluedot_%05.1f.png" % i, np_picture, origin='lower')