示例#1
0
 def test_arcball_1(self):
     ball = t.Arcball()
     ball = t.Arcball(initial=np.identity(4))
     ball.place([320, 320], 320)
     ball.down([500, 250])
     ball.drag([475, 275])
     R = ball.matrix()
     assert_allclose(np.sum(R), 3.90583455, atol=_ATOL)
示例#2
0
 def test_arcball_2(self):
     ball = t.Arcball(initial=[1, 0, 0, 0])
     ball.place([320, 320], 320)
     ball.setaxes([1, 1, 0], [-1, 1, 0])
     ball.setconstrain(True)
     ball.down([400, 200])
     ball.drag([200, 400])
     R = ball.matrix()
     assert_allclose(np.sum(R), 0.2055924)