test-3drot.py

This commit is contained in:
Star Brilliant 2014-06-08 20:46:24 +08:00
parent f5901c751e
commit 83808e3f8d

View File

@ -15,11 +15,13 @@ extcode = 0
def main(): def main():
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
for rotY in range(0, 361): for Y in (120, 360):
for rotZ in range(0, 361): for X in (160, 480):
outX, outY, outZ, shearX, shearY = danmaku2ass.ConvertFlashRotation(rotY, rotZ, X=0, Y=0, FOV=None) for rotY in range(0, 361):
logging.info('%4d, %4d => %4d, %4d, %4d' % (rotY, rotZ, outX, outY, outZ)) for rotZ in range(0, 361):
CompareMatrix(rotY, rotZ, outX, outY, outZ) trX, trY, outX, outY, outZ, scaleX, scaleY = danmaku2ass.ConvertFlashRotation(rotY, rotZ, X=X, Y=Y, width=640, height=480)
logging.info('(%3d, %3d), %4d, %4d => %4d, %4d, %4d, %4d%%' % (X, Y, rotY, rotZ, outX, outY, outZ, scaleX))
CompareMatrix(rotY, rotZ, outX, outY, outZ)
def CompareMatrix(rotY, rotZ, outX, outY, outZ): def CompareMatrix(rotY, rotZ, outX, outY, outZ):
def ApproxEqual(a, b, e=0.01): def ApproxEqual(a, b, e=0.01):