From 6abc7338e2c3a5f1cc84bbd9f3000cf5c27f627f Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Tue, 29 Apr 2014 21:56:48 +0800 Subject: [PATCH] Calculate WrapAngle(angle) in advance --- danmaku2ass.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 508965f..2f088e7 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -540,7 +540,9 @@ def ConvertFlashRotation(rotY, rotZ, X, Y, FOV=math.tan(2*math.pi/9.0)): return WrapAngle(theta) X = 2*X-1 Y = 2*Y-1 - if WrapAngle(rotY) in (0, 180) or WrapAngle(rotZ) in (0, 180): + rotY = WrapAngle(rotY) + rotZ = WrapAngle(rotZ) + if rotY in (0, 180) or rotZ in (0, 180): outX = 0 outY = -rotY # Positive value means clockwise in Flash outZ = -rotZ