Log in or register to post comments

Disabling QCAR Behaviour changes camera perspective/FoV (using NGUI)

April 8, 2013 - 7:17am #1

Hi all, 


I'm using NGUI to create a couple of 2D interface (i.e. non-AR) scenes around my AR application for iOS. 

I've set NGUI up to work with the AR Camera, which is working like a charm. Everything is positioned and scaled like it should. 


However, when a user is viewing a 2D scene, the camera should be disabled.  

But when I just disable the QCAR Behaviour component in the specific scene, the aspect ratio or field of view of the camera seems to change slightly, which leads to an annoying variation in UI assets. Attached are two screenshots, the one with Viewer on screen is with the QCAR Behaviour enabled, the blue one  disabled.  

I'm currently just covering the camera view with a full-screen-stretched sprite, but this is obviously not the ideal way to do it. 

So basically, I'm looking for a way to shut off the camera on the device without disabling the QCAR behaviour. 


I thought about posting this in the NGUI forums, but seems to my like the AR Camera is causing the issue, so thought I'd give this a try first. 

By the way, it's only noticable when actually deployed to an iOS device, in Unity it looks ok. 


Any help would be appreciated. 


Image icon QCARenabled.jpg44.22 KB
Image icon QCARdisabled.jpg13.73 KB

Disabling QCAR Behaviour changes camera perspective/FoV (using N

April 8, 2013 - 8:17am #5

Great to hear :)


Disabling QCAR Behaviour changes camera perspective/FoV (using N

April 8, 2013 - 8:13am #4

Hi NalinS - thanks for your speedy reply! 


As it turns out, I was looking for a solution to a problem that shouldn't have existed in the first place. 

After noticing the scaling/FoV issue, I run into a world of trouble when I pointed my iPad at an image target, which showed an exploded GUI in 3D on it! 

So I had a look around and found out that it's best to use a seperate camera and layer for (N)GUI, as you mentioned and as described here; http://www.tasharen.com/forum/index.php?topic=566.0 


So it was an NGUI issue after all, or actually, me using it the wrong way. 

I did a quick test and all is working fine now! 




Disabling QCAR Behaviour changes camera perspective/FoV (using N

April 8, 2013 - 7:48am #3

Hi jpvanmuijen,

So if I understand correctly you have a single ARCamera in the scene and simply enable/disable the QCARBehaviour component/script to try and turn AR on / off?

Can I just check whether it works ok on some iOS devices e.g. iPad 2 & iPad mini, but not on others?

One possibility could be that when using the ARCamera, it delivers the camera resolution rather than the screen resoultion and consequently your GUI is only setup for one of those - and when you turn off the QCARBehaviour script everything goes out of alignment.

Would it be at all possible to use two cameras in the scene?  i.e. an ARCamera and a regular Unity Camera (for NGUI) which is drawn on top.  Then maybe you might be able to switch off the ARCamera at the top level?




Disabling QCAR Behaviour changes camera perspective/FoV (using N

April 8, 2013 - 7:37am #2

Quick update; think it might be a better idea to use an additional 2D camera for NGUI instead of attaching the GUI on the AR camera. 



Log in or register to post comments