I am trying to create a top down game in Unity using an orthographic camera that is rotated at an angle (a) in the x direction.
Because of the tilted camera in an orthographic scenario, horizontal movement ist perceived faster than vertical movement. The more the camera deviates from the top down view (a = 90°), the greater this effect.
To compensate, I am first using a multiplier (m) to any given normalized direction vector (v) in the xz plane. Thus, m should increase, the more "vertical" v is. To achieve this, I am calculating the dot product of v with the vector that points in the z direction (0, 0, 1). Or in code:
m = Mathf.Abs(Vector3.Dot(v, Vector3.forward))
Now i dont know how to proceed, as the next step should be to multiply m with something that depends on a.
As far as I understand it correctly, the extreme scenarios are the following:
- If the camera points straight down (a = 90°), m should always be zero
- If the camera is parallel to the floor (a = 0°), m should go towards infinite
I hope somebody can explain how I can adjust m depending on a.
Thank you very much!