def add_table(): sphere = ray_tracer.create_sphere() global sun sun = ray_tracer.create_object(sphere, Materials.sun, (-300, 200, -100), 100) ray_tracer.create_square_with_picture('sky.jpg', Materials.picture, (0, 400, 0), 3000, (0, -1, 0)) table = ray_tracer.create_square_with_picture('table2.jpg', Materials.cloth, (-20, -10, -20), 150, (0, 1, 0)) ray_tracer.move(table, (40, 0, -5)) mesh = ray_tracer.create_mesh(filename='meshes/Espresso_Cup.obj', compress=1) ray_tracer.create_object(mesh, Materials.china, (0, -10, 0), 2.3) mesh = ray_tracer.create_mesh(filename='meshes/spoon/spoon.obj', compress=1) spoon = ray_tracer.create_object(mesh, Materials.ice, (10, -10.2, 20), .15) ray_tracer.rotate(spoon, (0, 0, 1), 0.04) ray_tracer.rotate(spoon, (0, 1, 0), 0.2) ray_tracer.move(spoon, (1, 0, 0)) ray_tracer.rotate_view_port((0, 1, 0), 0.5) ray_tracer.rotate_view_port((1, 0, 0), 0.3) ray_tracer.move_view_port((-11, 0, 0)) ray_tracer.move_view_port((0, 4, 0)) ray_tracer.c_color_gamma = 1.0 / 2.2 ray_tracer.c_apertureRadius = 2.5 ray_tracer.c_focus = (0, -10, 0) ray_tracer.c_viewPortRatio = 7.5 ray_tracer.move_view_port((-3, 1, 100))
def add_castle(): global mesh mesh = ray_tracer.create_mesh(filename='meshes/castle/castle.obj', position=(0, 0, -20), radius=0.05, color=(1, 1, 1), reflection=0.0, refraction=0.0, specular=0.0, diffuse=0.9, rotation=0.0) ray_tracer.rotate(mesh, (0, 1, 0), 0.4)
def add_tiny_house(): global mesh mesh = ray_tracer.create_mesh(filename='meshes/2l9281qs868w-Model/OBJ/FarmhouseOBJ.obj', position=(0, -10, -20), radius=0.5, color=(1, 1, 1), reflection=0.0, refraction=0.0, specular=0.0, diffuse=0.9, rotation=0.0) ray_tracer.rotate(mesh, (0, 1, 0), 0.4)
def add_girl(): global mesh mesh = ray_tracer.create_mesh(filename='meshes/Girl/girl.obj', position=(0, -5, 5), radius=2, color=(1, 1, 1), reflection=0.5, refraction=0.0, specular=0.0, diffuse=0.5, rotation=0.0) ray_tracer.rotate(mesh, (-1, 0, 0), pi / 2)
def add_house(): global mesh mesh = ray_tracer.create_mesh(filename='meshes/House01/House01.obj', position=(-7, -5, 0), radius=0.4, color=(1, 1, 1), reflection=0.5, refraction=0.0, specular=0.0, diffuse=0.5, rotation=0.0) ray_tracer.rotate(mesh, (0, 1, 0), pi / 4.5)
def test_bias(): sphere = ray_tracer.create_sphere() plane = ray_tracer.create_plane() ray_tracer.create_object(plane, Materials.wall, (6, 0, 0), 1, (-1, 0, 1)) ray_tracer.create_object(plane, Materials.wall, (0, 0, -10), 1, (0, 0, 1)) ray_tracer.create_object(sphere, Materials.strong_sun, (-8, 0, 4), 1) mesh = ray_tracer.create_mesh(filename='meshes/shape.obj', compress=1) tri = ray_tracer.create_object(mesh, Materials.brick, (-1, 0, 4), 3) ray_tracer.rotate(tri, (1, 0, 0), math.pi / 2) ray_tracer.rotate(tri, (0, 0, 1), 1.6) ray_tracer.c_global_decay = 0.0 ray_tracer.c_color_gamma = 1.0 / 2.2 ray_tracer.c_apertureRadius = 0.0 ray_tracer.c_viewPortRatio = 7.5 ray_tracer.move_view_port((5, 0, 0))