Пример #1
0
cameraPos = np.array([0, 0, 0.1])

width, height = 320, 180

imagePlane = np.array([
    [-0.89, +0.5, 1], [+0.89, +0.5, 1],
    [-0.89, -0.5, 1], [+0.89, -0.5, 1]
])

scene = Scene(cameraPos, width, height, imagePlane, 1, np.array([1, 1, 1]), 3)

scene.add_hitable(Sphere(centre=np.array([-0.2, 0, 2]), radius=0.7, material=BlinnPhongMaterial({
    "ambient": np.array([0.1, 0, 0]),
    "diffuse": np.array([0.7, 0, 0]),
    "specular": np.array([1, 1, 1]),
    "shininess": 100,
    "reflection": 1
})))

scene.add_hitable(Sphere(centre=np.array([-0.3, 0, 1]), radius=0.15, material=BlinnPhongMaterial({
    "ambient": np.array([0, 0.1, 0]),
    "diffuse": np.array([0, 0.7, 0]),
    "specular": np.array([1, 1, 1]),
    "shininess": 100,
    "reflection": 1
})))


scene.add_hitable(Sphere(centre=np.array([0, -9000, 1]), radius=9000 - 1.5, material=BlinnPhongMaterial({
    "ambient": np.array([0.1, 0.1, 0.1]),