Skip to content
Snippets Groups Projects
Commit 4a920db8 authored by Benjamin Koltes's avatar Benjamin Koltes
Browse files

Fix final + nouveaux rendus

parent 14c2402d
No related branches found
No related tags found
No related merge requests found
Showing
with 9 additions and 9 deletions
Image Spheres Bleues Finales/one_sphere_26.png

10.7 KiB

Image Spheres Bleues Finales/one_sphere_27.png

10.5 KiB

Image Spheres Bleues Finales/one_sphere_28.png

10.8 KiB

Image Spheres Bleues Finales/one_sphere_29.png

11 KiB

Image Spheres Bleues Finales/one_sphere_3.png

8.23 KiB

Image Spheres Bleues Finales/one_sphere_30.png

10.7 KiB

Image Spheres Bleues Finales/one_sphere_31.png

10.1 KiB

Image Spheres Bleues Finales/one_sphere_32.png

9.28 KiB

Image Spheres Bleues Finales/one_sphere_33.png

8.34 KiB

Image Spheres Bleues Finales/one_sphere_34.png

7.44 KiB

Image Spheres Bleues Finales/one_sphere_35.png

7.03 KiB

Image Spheres Bleues Finales/one_sphere_4.png

9.3 KiB

Image Spheres Bleues Finales/one_sphere_5.png

10.2 KiB

Image Spheres Bleues Finales/one_sphere_6.png

10.9 KiB

Image Spheres Bleues Finales/one_sphere_7.png

11 KiB

Image Spheres Bleues Finales/one_sphere_8.png

10.7 KiB

Image Spheres Bleues Finales/one_sphere_9.png

10.5 KiB

No preview for this file type
...@@ -13,13 +13,13 @@ def phong_illuminate(light, position, normal, object, viewer): ...@@ -13,13 +13,13 @@ def phong_illuminate(light, position, normal, object, viewer):
R = 2*(L*N)*N - L R = 2*(L*N)*N - L
V = (viewer - position).normalized() V = (viewer - position).normalized()
if (N*L) <= 0: i = ((kd*(max(L*N, 0)) + ks*(max(0, R*V))**alpha))
return 0*position
i = ((kd*(L*N) + ks*(R*V)**alpha))
if i < 0: if i < 0:
i = 0 i = 0
elif i > 1: # print(-1)
i = 1 # elif i > 1:
# i = 1
# print(1)
return i*(light.color ** object.material.color) return i*(light.color ** object.material.color)
......
...@@ -5,12 +5,12 @@ from raytracer import raytracer_render ...@@ -5,12 +5,12 @@ from raytracer import raytracer_render
from matplotlib.image import imsave from matplotlib.image import imsave
from math import cos, sin, pi from math import cos, sin, pi
camera = Camera(200,200,2) camera = Camera(400,400,2)
materiau_sphere = Material(Vector((0,0,1)), .5, .3, .7, 20, 1) materiau_sphere = Material(Vector((0,0,1)), .1, .1, .1, 10, 1)
sphere = Sphere(Vector([0,0,3]), 1, materiau_sphere) sphere = Sphere(Vector([0,0,3]), 1, materiau_sphere)
for theta in range(36): for theta in range(36):
a = 3*cos(theta*pi/18) a = 4*cos(theta*pi/18)
b = 3*sin(theta*pi/18) b = 4*sin(theta*pi/18)
lumiere = Spotlight(Vector((0, a, 3+b)), Vector((1,1,1))) lumiere = Spotlight(Vector((0, a, 3+b)), Vector((1,1,1)))
lumiere_2 = Spotlight(Vector((0, -a, 3-b)), Vector((1,1,1))) lumiere_2 = Spotlight(Vector((0, -a, 3-b)), Vector((1,1,1)))
scene = Scene() scene = Scene()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment