Experimental rotation conversion

This commit is contained in:
Star Brilliant 2014-04-28 23:12:36 +08:00
parent 83d23a8c99
commit f598670da8

View File

@ -549,7 +549,7 @@ def ConvertFlashRotation(rotY, rotZ, X, Y, FOV=math.tan(2*math.pi/9.0)):
outZ = math.atan2(-math.cos(rotY)*math.sin(rotZ), math.cos(rotZ))*180/math.pi
#outX = math.asin(math.sin(rotY)*math.sin(rotZ))*180/math.pi
#outX = math.acos(math.cos(rotY)/math.cos(outY*math.pi/180.0))*180/math.pi
outX = math.atan2(-math.sin(rotY)*math.cos(rotZ)*math.cos(outY*math.pi/180.0), math.cos(rotY)*math.sin(outY*math.pi/180.0))*180/math.pi
outX = math.atan2(-math.sin(rotY)*math.cos(rotZ)*abs(math.cos(outY*math.pi/180.0)*(1 if math.sin(outY*math.pi/180.0) >= 0 else -1)), math.cos(rotY)*abs(math.sin(outY*math.pi/180.0)*(1 if math.cos(outY*math.pi/180.0) >= 0 else -1)))*180/math.pi
'''
print(
(rotY*180.0/math.pi, rotZ*180.0/math.pi),