Revert "Correct ASS focal length to width*4/3"

This reverts commit 4fa2a01e1e.
This commit is contained in:
Star Brilliant 2014-06-10 22:21:15 +08:00
parent 4fa2a01e1e
commit a145947772

View File

@ -507,8 +507,8 @@ def GetZoomFactor(SourceSize, TargetSize):
# Calculation is based on https://github.com/jabbany/CommentCoreLibrary/issues/5#issuecomment-40087282 # Calculation is based on https://github.com/jabbany/CommentCoreLibrary/issues/5#issuecomment-40087282
# and https://github.com/m13253/danmaku2ass/issues/7#issuecomment-41489422 # and https://github.com/m13253/danmaku2ass/issues/7#issuecomment-41489422
# Flash FOV = width*2.0/math.tan(100*math.pi/360.0) # ASS FOV = width*4/3.0
# But ASS FOV = width*4/3.0 will be used instead # 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) # Result: (transX, transY, rotX, rotY, rotZ, scaleX, scaleY)
def ConvertFlashRotation(rotY, rotZ, X, Y, width, height): def ConvertFlashRotation(rotY, rotZ, X, Y, width, height):
def WrapAngle(deg): 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 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 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) trZ = (trX-width/2)*math.sin(rotY)
FOV = width*4/3.0 FOV = width*math.tan(2*math.pi/9.0)/2
try: try:
scaleXY = FOV/(FOV+trZ) scaleXY = FOV/(FOV+trZ)
except ZeroDivisionError: except ZeroDivisionError: