예제 #1
0
    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)
예제 #2
0
 def test_scaleByFactor(self):
     matrix = Matrix()
     matrix.scaleByFactor(2)
     assert matrix.getScale() == Vector(2, 2, 2)
예제 #3
0
    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)
예제 #4
0
 def test_scaleByFactor(self):
     matrix = Matrix()
     matrix.scaleByFactor(2)
     assert matrix.getScale() == Vector(2, 2, 2)