Log in or register to post comments

Why is Game View zoomed in, and how do I zoom out again?

May 23, 2014 - 7:10am #1

This is a strange one.

I'm using a Logitech webcam.  When I snap a photo using the logitech software, I can see the full image.

But when I enter Game preview mode, what's shown in Unity is like a zoomed in picture with the edges cut off. 

At first, I could expand the window to show the entire image.  But that just suddenly stopped working and now I can't see the full image. 

I've just spent more than day messing around getting all of this setup, and if I have to reset my camera position now.....a lot of that work is going to be wasted. 

How do I get the Game preview window to show everything the camera is seeing?

Why is Game View zoomed in, and how do I zoom out again?

May 27, 2014 - 9:28am #2

The "zoom" effect is simply due to the fact that the Camera Aspect ratio is different from the Screen (or Player window) aspec ratio; therefore, the Vuforia engine will make a sort of "best fit" of the image, which will result in clipping part of the image (note: not doing this would result in image distortion);

if you want to see the full image, you can do that, but you will likely get black bands to fill the aspect ratio gap.

Technically, you can achieve the "rescaling" of the camera video background image by implementing the IVideoBackgroundEventHandler  interface and implementing the public void OnVideoBackgroundConfigChanged () of such interface;

in that mehod, you could set your custom VideoBackroundConfiguration (with custom size) and set it in:

QCARRenderer.Instance.SetVideoBackgroundConfig (  your_custom_video_bg_cfg )

Alternatively, you could look at the BackgroundTextureAccess sample, where the camera image is rendered into a texture and the texture is applied to a rectangular (plane) mesh.   In this case, you can study the technique used there and adjust the scale of the mesh to make it look bigger or smaller.



Log in or register to post comments