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

ajout des shadows

parent 2ea10495
No related branches found
No related tags found
No related merge requests found
# Show to python where to find the modules
import sys
sys.path.append('..')
from scene import *
from light import Spotlight
from camera import Camera
from raytracer import raytracer_render
from matplotlib.image import imsave
import sys
camera = Camera(200,200,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)
lumiere = Spotlight(Vector((1,1,0)), 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.png',affiche)
scenes/two_spheres.png

7.14 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment