diff --git a/Two_spheres red & blue/two_spheres.wmv b/Two_spheres red & blue/two_spheres.wmv new file mode 100644 index 0000000000000000000000000000000000000000..02fa7a88a733053dd9970f87c8275e33e208a3a0 Binary files /dev/null and b/Two_spheres red & blue/two_spheres.wmv differ diff --git a/Two_spheres red & blue/two_spheres_0.png b/Two_spheres red & blue/two_spheres_0.png new file mode 100644 index 0000000000000000000000000000000000000000..98557158704d4d2c73007c90f7343037efdb96fa Binary files /dev/null and b/Two_spheres red & blue/two_spheres_0.png differ diff --git a/Two_spheres red & blue/two_spheres_1.png b/Two_spheres red & blue/two_spheres_1.png new file mode 100644 index 0000000000000000000000000000000000000000..93faa4c245f47442387427af66e12329a7f0f7c2 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_1.png differ diff --git a/Two_spheres red & blue/two_spheres_10.png b/Two_spheres red & blue/two_spheres_10.png new file mode 100644 index 0000000000000000000000000000000000000000..3c61c6fb298f6d908becc61777843e384185a3b1 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_10.png differ diff --git a/Two_spheres red & blue/two_spheres_11.png b/Two_spheres red & blue/two_spheres_11.png new file mode 100644 index 0000000000000000000000000000000000000000..204e53435b9dce25818cfd13be2fc3499f108433 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_11.png differ diff --git a/Two_spheres red & blue/two_spheres_12.png b/Two_spheres red & blue/two_spheres_12.png new file mode 100644 index 0000000000000000000000000000000000000000..1f6df45f1d28685fa568f186965b9c06d997f9e8 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_12.png differ diff --git a/Two_spheres red & blue/two_spheres_13.png b/Two_spheres red & blue/two_spheres_13.png new file mode 100644 index 0000000000000000000000000000000000000000..c14fbb48338f569aad257656660e312838b2ecdd Binary files /dev/null and b/Two_spheres red & blue/two_spheres_13.png differ diff --git a/Two_spheres red & blue/two_spheres_14.png b/Two_spheres red & blue/two_spheres_14.png new file mode 100644 index 0000000000000000000000000000000000000000..f38c91870628f5e0bcbabf8ae65a66a85c3002e8 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_14.png differ diff --git a/Two_spheres red & blue/two_spheres_15.png b/Two_spheres red & blue/two_spheres_15.png new file mode 100644 index 0000000000000000000000000000000000000000..e5ea36251b11d67d87c1011d1628681290d19954 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_15.png differ diff --git a/Two_spheres red & blue/two_spheres_16.png b/Two_spheres red & blue/two_spheres_16.png new file mode 100644 index 0000000000000000000000000000000000000000..8d5799e99a302c8350c87e5a29fa276f4d220d50 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_16.png differ diff --git a/Two_spheres red & blue/two_spheres_17.png b/Two_spheres red & blue/two_spheres_17.png new file mode 100644 index 0000000000000000000000000000000000000000..5aea411d5d120c81b20cf05f1950f3dda1c78923 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_17.png differ diff --git a/Two_spheres red & blue/two_spheres_18.png b/Two_spheres red & blue/two_spheres_18.png new file mode 100644 index 0000000000000000000000000000000000000000..5a911cf91dab51fbf8762fbf8b0946b59b10bda6 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_18.png differ diff --git a/Two_spheres red & blue/two_spheres_19.png b/Two_spheres red & blue/two_spheres_19.png new file mode 100644 index 0000000000000000000000000000000000000000..47de1090ad6f408f7d109a2b0b6e5f4a208ee2ac Binary files /dev/null and b/Two_spheres red & blue/two_spheres_19.png differ diff --git a/Two_spheres red & blue/two_spheres_2.png b/Two_spheres red & blue/two_spheres_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e1c30b468004d44fa05adf3ac4ac1cf8f856498c Binary files /dev/null and b/Two_spheres red & blue/two_spheres_2.png differ diff --git a/Two_spheres red & blue/two_spheres_20.png b/Two_spheres red & blue/two_spheres_20.png new file mode 100644 index 0000000000000000000000000000000000000000..65567d5d0977bd75f71a0b5bb7ee35c6783053c1 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_20.png differ diff --git a/Two_spheres red & blue/two_spheres_21.png b/Two_spheres red & blue/two_spheres_21.png new file mode 100644 index 0000000000000000000000000000000000000000..913eff8baf7d3d86026ecf19b89a276a78b6a85b Binary files /dev/null and b/Two_spheres red & blue/two_spheres_21.png differ diff --git a/Two_spheres red & blue/two_spheres_22.png b/Two_spheres red & blue/two_spheres_22.png new file mode 100644 index 0000000000000000000000000000000000000000..96b5b1aa0a5553b5053e254737ac85602cc40a6c Binary files /dev/null and b/Two_spheres red & blue/two_spheres_22.png differ diff --git a/Two_spheres red & blue/two_spheres_23.png b/Two_spheres red & blue/two_spheres_23.png new file mode 100644 index 0000000000000000000000000000000000000000..4739f1f31aebddb4f474afb8430b8ece249381d5 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_23.png differ diff --git a/Two_spheres red & blue/two_spheres_24.png b/Two_spheres red & blue/two_spheres_24.png new file mode 100644 index 0000000000000000000000000000000000000000..584ece0a052c3b2a7537c19f8f20a14e78e90a99 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_24.png differ diff --git a/Two_spheres red & blue/two_spheres_25.png b/Two_spheres red & blue/two_spheres_25.png new file mode 100644 index 0000000000000000000000000000000000000000..9dc0263ae9cd3bbb119a26b1ae757711c50b6590 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_25.png differ diff --git a/Two_spheres red & blue/two_spheres_26.png b/Two_spheres red & blue/two_spheres_26.png new file mode 100644 index 0000000000000000000000000000000000000000..aeb7d0068275e65421bf767f394a5413e4a8e6e2 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_26.png differ diff --git a/Two_spheres red & blue/two_spheres_27.png b/Two_spheres red & blue/two_spheres_27.png new file mode 100644 index 0000000000000000000000000000000000000000..3603048a805f32b38af4873f53392b4cb3ad61a1 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_27.png differ diff --git a/Two_spheres red & blue/two_spheres_28.png b/Two_spheres red & blue/two_spheres_28.png new file mode 100644 index 0000000000000000000000000000000000000000..b2603794f8ba959330344effb819f56b65f1187b Binary files /dev/null and b/Two_spheres red & blue/two_spheres_28.png differ diff --git a/Two_spheres red & blue/two_spheres_29.png b/Two_spheres red & blue/two_spheres_29.png new file mode 100644 index 0000000000000000000000000000000000000000..f08262be620cd0ac53f4c6b7ebb881235463cf07 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_29.png differ diff --git a/Two_spheres red & blue/two_spheres_3.png b/Two_spheres red & blue/two_spheres_3.png new file mode 100644 index 0000000000000000000000000000000000000000..75d71c7b825cfacdd1caa44efbbe28adafe27c8b Binary files /dev/null and b/Two_spheres red & blue/two_spheres_3.png differ diff --git a/Two_spheres red & blue/two_spheres_30.png b/Two_spheres red & blue/two_spheres_30.png new file mode 100644 index 0000000000000000000000000000000000000000..48b269e03e10a848ccfb6df12ad4b01d7d4c6284 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_30.png differ diff --git a/Two_spheres red & blue/two_spheres_31.png b/Two_spheres red & blue/two_spheres_31.png new file mode 100644 index 0000000000000000000000000000000000000000..88a3401b0afe88d281b25ee79218f5dfb63c8f86 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_31.png differ diff --git a/Two_spheres red & blue/two_spheres_32.png b/Two_spheres red & blue/two_spheres_32.png new file mode 100644 index 0000000000000000000000000000000000000000..98e114ed3fa40cf4d2677dc448adbed3d145e162 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_32.png differ diff --git a/Two_spheres red & blue/two_spheres_33.png b/Two_spheres red & blue/two_spheres_33.png new file mode 100644 index 0000000000000000000000000000000000000000..7506316d0b3d07649df76265c2669e73fa2125c0 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_33.png differ diff --git a/Two_spheres red & blue/two_spheres_34.png b/Two_spheres red & blue/two_spheres_34.png new file mode 100644 index 0000000000000000000000000000000000000000..313dacca901f16c21681fe4c061f9d51d9aa81d1 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_34.png differ diff --git a/Two_spheres red & blue/two_spheres_35.png b/Two_spheres red & blue/two_spheres_35.png new file mode 100644 index 0000000000000000000000000000000000000000..0cdd9546d005d0451373e55d8b03c59c13d88fce Binary files /dev/null and b/Two_spheres red & blue/two_spheres_35.png differ diff --git a/Two_spheres red & blue/two_spheres_4.png b/Two_spheres red & blue/two_spheres_4.png new file mode 100644 index 0000000000000000000000000000000000000000..c99549338146f24a94e570d2a99952a33e278953 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_4.png differ diff --git a/Two_spheres red & blue/two_spheres_5.png b/Two_spheres red & blue/two_spheres_5.png new file mode 100644 index 0000000000000000000000000000000000000000..eb4b8b220a3c8ce1922791ea731a0b21726eb6ef Binary files /dev/null and b/Two_spheres red & blue/two_spheres_5.png differ diff --git a/Two_spheres red & blue/two_spheres_6.png b/Two_spheres red & blue/two_spheres_6.png new file mode 100644 index 0000000000000000000000000000000000000000..695c1329afeaf141428f6ad0e12ad172e1f613ef Binary files /dev/null and b/Two_spheres red & blue/two_spheres_6.png differ diff --git a/Two_spheres red & blue/two_spheres_7.png b/Two_spheres red & blue/two_spheres_7.png new file mode 100644 index 0000000000000000000000000000000000000000..c0ac80d3b5c17088eda527b398cb8c916cad93a9 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_7.png differ diff --git a/Two_spheres red & blue/two_spheres_8.png b/Two_spheres red & blue/two_spheres_8.png new file mode 100644 index 0000000000000000000000000000000000000000..46cb178a878ddd6800fbfc68be3923cf88f325d6 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_8.png differ diff --git a/Two_spheres red & blue/two_spheres_9.png b/Two_spheres red & blue/two_spheres_9.png new file mode 100644 index 0000000000000000000000000000000000000000..3c61c6fb298f6d908becc61777843e384185a3b1 Binary files /dev/null and b/Two_spheres red & blue/two_spheres_9.png differ diff --git a/scenes/one_sphere.py b/scenes/one_sphere.py index 723bef097ea4d59d5d65b5a980a6fecb1d006800..2088ad98f2ff370d1a1f69b123857a8eeda9be1b 100644 --- a/scenes/one_sphere.py +++ b/scenes/one_sphere.py @@ -10,7 +10,7 @@ from matplotlib.image import imsave import sys camera = Camera(200,200,1) -materiau_sphere = Material(Vector((0,0,1)), .5, .5, .5, 10, 1) +materiau_sphere = Material(Vector((0,0,1)), .5, .5, .5, 10, 0) sphere = Sphere(Vector([0,0,3]), 1, materiau_sphere) lumiere = Spotlight(Vector((1,1,0)), Vector((1,1,1))) scene = Scene() diff --git a/script_shadow.py b/script_shadow.py new file mode 100644 index 0000000000000000000000000000000000000000..da14564ddf54c2688997f6ef717be1dde77249b5 --- /dev/null +++ b/script_shadow.py @@ -0,0 +1,24 @@ +from scene import * +from light import Spotlight +from camera import Camera +from raytracer import raytracer_render +from matplotlib.image import imsave +import sys +from math import cos, sin, pi + +camera = Camera(400,400,1) +materiau_sphere_bleue = Material(Vector((0,0,1)), .5, .4, .6, 50, 1) +materiau_sphere_rouge = Material(Vector((1,0,0)), .4, .3, .2, 20, 1) +sphere_bleue = Sphere(Vector([0,0,3]), .8, materiau_sphere_bleue) +sphere_rouge = Sphere(Vector([0.5,0.5,2]), .5, materiau_sphere_rouge) +for theta in range(36): + a = 5*cos(theta*pi/18) + b = 5*sin(theta*pi/18) + lumiere = Spotlight(Vector((1,1+a,b)), Vector((1,1,1))) + scene = Scene() + scene.add_object(sphere_bleue) + scene.add_object(sphere_rouge) + scene.add_light(lumiere) + affiche = raytracer_render(camera, scene) + imsave('two_spheres_' + str(theta) + '.png',affiche) +