Hi folks,
I'm not sure where to post this, so I hope this location is ok.
This is my issue:
- in unity I create a plane in front of the camera (centered to the viewport), in the game view it fits exactly. I am using a landscape mode.
- as soon as I press play the camera seems to zoom in on the plane and the plane no longer fits the viewport.
I saw it might be related to vuforia needing to stretch the camera image or something like that, but vuforia says the video feed is 640x480, which is exactly the resolution I used to position everything.
What is causing this and how can I fix it? Right now I am using this method to recalculate the fov the ARCamera is using to reposition my objects:
Vector3 worldPoint = QCARManager.Instance.ARCamera.ScreenToWorldPoint(new Vector3(0, 0, 10));
Vector3 localPoint = QCARManager.Instance.ARCamera.transform.InverseTransformPoint(worldPoint);
float halfFov = Mathf.Atan2(localPoint.y, localPoint.z);
It results in an fov that is different than that what the editor is showing, but it actually works.
It seems like such a basic thing: position something in front of the camera and make it fit the viewport?
I need this functionality because I want to move objects from the marker space to the camera space and back again.
Thanks in advance for better ideas!
Hans
Hi Alessandro,
thanks for the info! Much appreciated!
best,
Hans