Exemplo n.º 1
0
def step_impl(context):
    expected = matrix(4, 4)
    for row in range(4):
        for col in range(4):
            expected[row][col] = float(context.table[row][col])
    actual = context.b
    assert_matrix(actual, expected)
def step_assert_transformation_matrix_of_object_at_index(
    context, index, tx, ty, tz, sx, sy, sz):
    assert_matrix(
        context.w.objects[index].transform(),
        multiply_matrix(scaling(sx, sy, sz), translation(tx, ty, tz)))
Exemplo n.º 3
0
def step_impl(context):
    actual = multiply_matrix(context.c, inverse(context.b))
    expected = context.m
    assert_matrix(actual, expected)
Exemplo n.º 4
0
def step_assert_transform_of_s_equals_translation(context, x, y, z):
    assert_matrix(context.s.transform(), translation(x, y, z))
Exemplo n.º 5
0
def step_assert_transform_of_s_equals_identity_matrix(context):
    assert_matrix(context.s.transform(), identity_matrix())
Exemplo n.º 6
0
def step_assert_transform_of_c_equals_view_transform(context):
    assert_matrix(context.c.transform(),
                  view_transform(context.p, context.to, context.up))
Exemplo n.º 7
0
def step_assert_transform_of_pattern_equals_translation_matrix(
    context, x, y, z):
    assert_matrix(context.pattern.transform(), translation(x, y, z))
Exemplo n.º 8
0
def step_assert_transform_of_pattern_equals_identity_matrix(context):
    assert_matrix(context.pattern.transform(), identity_matrix())