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)))
def step_impl(context):
    actual = multiply_matrix(context.c, inverse(context.b))
    expected = context.m
    assert_matrix(actual, expected)
示例#4
0
def step_assert_transform_of_s_equals_translation(context, x, y, z):
    assert_matrix(context.s.transform(), translation(x, y, z))
示例#5
0
def step_assert_transform_of_s_equals_identity_matrix(context):
    assert_matrix(context.s.transform(), identity_matrix())
示例#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))
示例#7
0
def step_assert_transform_of_pattern_equals_translation_matrix(
    context, x, y, z):
    assert_matrix(context.pattern.transform(), translation(x, y, z))
示例#8
0
def step_assert_transform_of_pattern_equals_identity_matrix(context):
    assert_matrix(context.pattern.transform(), identity_matrix())