import math
def GetIsoCamPitch(w=256,h=128):
r = float(float(h)/float(w))
return math.degrees(math.asin(r))
def GetTileSizeFromCameraPitch(a=45,w=0,h=0,ret='r'):
'''
Get the ratio, w, or h, from camera's pitch a
If w is provided then h is ignored, vice-versa
'''
r = math.sin(math.radians(a))
if 'r' in ret:
return r
if 'w' in ret:
# this assumes that h was provided for
return 1/r*h
if 'h' in ret:
#assumes that w was provided
return w*r
print GetTileRatioFromCameraPitch(35,w=256,ret='h')

Code (Python) to calculate the camera down (pitch) angle to achieve a Tile width/height ratio, and get tile ratio from camera pitch.

### Like this:

Like Loading...

*Related*