Google Cardboard + Vuforia - Camera size is small
I'm trying to integrate Google Cardboard SDK to Vuforia Unity project. The way of achieving this is described here. My problem is that the camera size is too small. I'm uploading pictures to explain it better:
Here is what I achieved:
Here is what I expected to be:
As you can see the camera size in the first picture is smaller than in the second. I'm pretty new to Vuforia and Unity and things aren't very clear. Can you tell me why the camera size is so small? Is there a way to make it big enough? Thanks in advance!
Answer by dolims · Aug 31, 2015 at 03:58 AM
Comment out the following line in CardboardEye.cs:
Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left);
It is forcing each stereo camera eye to use the same aspect ratio as the whole screen, which is not what you want.
I am not using cardboard, but am having the same problem. I load a prefab ARCamera into my scene, and enable stereo camera and cannot find the options I'm looking for the use the correct aspect ratio(s). Any chance you know about this?
No, the internals of Vuforia are a bit mysterious to me. We found the fix above by luck, because I'm familiar with the code in CardboardEye.cs -- their modification to the script stood out to me, so we just tried commenting it out and that worked.
Thanks anyways. I even searched for the above function name in the entire project in studio and only came up with the definition.
Answer by Guxar · Jan 16, 2016 at 07:31 PM
@dolims After you comment out that line, how do you change the aspect ratio? I dont know if I'm doing it wrong but, I try to change the ratio by changeing the values of the W and H in ViewportRect in the main camera rigth and left but nothing happens. How do you change it? Thank you.
Values on the left and right cameras are copied from $$anonymous$$ain Camera at startup and when the app resumes, or when you call StereoController.UpdateStereoValues(). So your changes might be getting overwritten.