Ejemplo n.º 1
0
def __mupltiply_matrix_vector(self, name1, name2, x, y, z):
    test_vector = Vector(float(x), float(y), float(z))
    print("\nExpected:")
    print(test_vector)
    print("\nGot:")
    print(getattr(world, name1) * getattr(world, name2))
    assert getattr(world, name1) * getattr(world, name2) == test_vector
Ejemplo n.º 2
0
def _ray_direction_equals_vector(self, name, x, y, z):
    test_vector = Vector(float(x), float(y), float(z))
    print("\nExpected:")
    print(test_vector)
    print("\nGot:")
    print(getattr(world, name).direction)
    assert getattr(world, name).direction == test_vector
Ejemplo n.º 3
0
def _check_saved_ray_direction(self, name, vx, vy, vz):
    test_vector = Vector(float(vx), float(vy), float(vz))
    vector = getattr(world, name).saved_ray.direction
    print("\nExpected:")
    print(test_vector)
    print("\nGot:")
    print(vector)
    assert vector == test_vector
Ejemplo n.º 4
0
def _compare_reflectv_by_value(self, name, x, y, z):
    test_value = Vector(float(x), float(y), float(z))
    value = getattr(world, name).reflectv
    print("\nExpected:")
    print(test_value)
    print("\nGot:")
    print(value)
    assert value == test_value
Ejemplo n.º 5
0
def _ray_from_values(self, name, px, py, pz, vx, vy, vz):
    setattr(
        world, name,
        Ray(Point(float(px), float(py), float(pz)),
            Vector(float(vx), float(vy), float(vz))))