Skip to content
Snippets Groups Projects
Select Git revision
  • f701b26f4ed4a608c0ace8d43c09483e70504c61
  • master default
  • goodpaths
  • movie-page
  • front-bilel
  • vieille-branche
  • octofront
  • branche-TP-de-Tom
8 results

recommendation.py

Blame
  • reflection.py 787 B
    # 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)), .7, .7, .7, 100, .7)
    materiau_sphere_rouge = Material(Vector((1,0,0)), .7, .7, .7, 100, .7)
    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_reflection.png',affiche)