def test_setByScaleFactor(self): matrix = Matrix() matrix.setByScaleFactor(0.5) numpy.testing.assert_array_almost_equal( matrix.getData(), numpy.array([[0.5, 0, 0, 0], [0, 0.5, 0, 0], [0, 0, 0.5, 0], [0, 0, 0, 1]])) assert matrix.getScale() == Vector(0.5, 0.5, 0.5)
def test_scaleByFactor(self): matrix = Matrix() matrix.scaleByFactor(2) assert matrix.getScale() == Vector(2, 2, 2)
def test_setByScaleFactor(self): matrix = Matrix() matrix.setByScaleFactor(0.5) numpy.testing.assert_array_almost_equal(matrix.getData(), numpy.array([[0.5,0,0,0],[0,0.5,0,0],[0,0,0.5,0],[0,0,0,1]])) assert matrix.getScale() == Vector(0.5, 0.5, 0.5)