# 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
from math import cos, sin, pi

camera = Camera(400,400,2)
materiau_sphere = Material(Vector((0,0,1)), .1, .1, .1, 10, 1)
sphere = Sphere(Vector([0,0,3]), 1, materiau_sphere)
for theta in range(36):
    a = 4*cos(theta*pi/18)
    b = 4*sin(theta*pi/18)
    lumiere = 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.add_object(sphere)
    scene.add_light(lumiere)
    scene.add_light(lumiere_2)
    affiche = raytracer_render(camera, scene)
    imsave('one_sphere_' + str(theta) + '.png',affiche)
    print(theta)