From 2f8f4cf63f3341f713f0e267b55f87ae0bd11f75 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Sun, 24 Nov 2013 12:59:09 +0800 Subject: [PATCH] Fix Y-axis rotation --- danmaku2ass.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index e4a0682..556363b 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -289,7 +289,10 @@ def WriteCommentBilibiliPositioned(f, c, width, height, styleid): styles.append('\\move(%s, %s, %s, %s, %s, %s)' % (from_x, from_y, to_x, to_y, delay, delay+duration)) if rotate_z != 0: styles.append('\\frz%s' % rotate_z) - if rotate_y != 0: + if rotate_y != 0: + styles.append('\\frx%s' % (rotate_y*math.sin(rotate_z*math.pi/180))) + styles.append('\\fry%s' % (rotate_y*math.cos(rotate_z*math.pi/180))) + elif rotate_y != 0: styles.append('\\fry%s' % rotate_y) if fontface: styles.append('\\fn%s' % fontface.replace('\\', '\\\\').replace('{', '\\{').replace('}', '\\}'))