From a145947772363f95948f84eac9b4f39f5f1429c9 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Tue, 10 Jun 2014 22:21:15 +0800 Subject: [PATCH] Revert "Correct ASS focal length to width*4/3" This reverts commit 4fa2a01e1e2dea830d18fffd80f2fc3702e546ff. --- danmaku2ass.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 8f93d96..b0a8eb8 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -507,8 +507,8 @@ def GetZoomFactor(SourceSize, TargetSize): # Calculation is based on https://github.com/jabbany/CommentCoreLibrary/issues/5#issuecomment-40087282 # and https://github.com/m13253/danmaku2ass/issues/7#issuecomment-41489422 -# Flash FOV = width*2.0/math.tan(100*math.pi/360.0) -# But ASS FOV = width*4/3.0 will be used instead +# ASS FOV = width*4/3.0 +# But Flash FOV = width*2.0/math.tan(100*math.pi/360.0) will be used instead # Result: (transX, transY, rotX, rotY, rotZ, scaleX, scaleY) def ConvertFlashRotation(rotY, rotZ, X, Y, width, height): def WrapAngle(deg): @@ -532,7 +532,7 @@ def ConvertFlashRotation(rotY, rotZ, X, Y, width, height): trX = (X*math.cos(rotZ)+Y*math.sin(rotZ))/math.cos(rotY)+(1-math.cos(rotZ)/math.cos(rotY))*width/2-math.sin(rotZ)/math.cos(rotY)*height/2 trY = Y*math.cos(rotZ)-X*math.sin(rotZ)+math.sin(rotZ)*width/2+(1-math.cos(rotZ))*height/2 trZ = (trX-width/2)*math.sin(rotY) - FOV = width*4/3.0 + FOV = width*math.tan(2*math.pi/9.0)/2 try: scaleXY = FOV/(FOV+trZ) except ZeroDivisionError: