Thanks for the response guys,
@robertu taking your advice I found the following post [auto-scale][1]
public class PositionCamera : MonoBehaviour {
public float fWidth = 9.0f; // Desired width
void Start () {
float fT = fWidth / Screen.width * Screen.height;
fT = fT / (2.0f * Mathf.Tan (0.5f * Camera.main.fieldOfView * Mathf.Deg2Rad));
Vector3 v3T = Camera.main.transform.position;
v3T.z = -fT;
transform.position = v3T;
}
This works perfectly if the camera is at a 90 degree angle to the image, the problem is, my Camera POV is at an angle to the Image to give the perception of depth.
Any idea how i could reconfigure the above code for my situation? (I'm a bit lost at how it works).
This is the image:
![alt text][2]
This is the Camera POV:
![alt text][3]
[1]: http://answers.unity3d.com/questions/403732/auto-scale-camera-depending-on-screen-size-how.html
[2]: /storage/temp/10187-background_template.png
[3]: /storage/temp/10189-pov.png
↧