Author Topic: Issues with Vuforia  (Read 7223 times)

reis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Issues with Vuforia
« on: September 17, 2013, 10:42:39 AM »
Hi guys,

I'm currently having issues with Vuforia and NGUI.
I've imported all the demo scene into my current project and done the following




Hierarchy:

AR Camera - Culling Mask - NGUI la[size=78%]yer, Layer "Default"[/size][/i]


UI Root -UIRoot Script and changed the Unity layer to NGUI

  UIRoot> Camera - UICamera Script, Clear Flags to "Depth only" Culling mask to "NGUI Layer" Projection Orthographic, Size 1 and          Depth 1. Layer "NGUI Layer"

      UIRoot> Camera> Anchor - UIAnchor Script, Side "Bottom".  Layer "NGUI Layer"

            UIRoot> Camera> Anchor> Panel - UIPanel Script, Depth sort and Panel Tool checked. Layer, "Default"

                 UIRoot> Camera> Anchor> Panel > Sprite - Layer, "Default"


The anchor doesn't respect the screen size,
Also I can move the UI Root game object, and in my game preview window the NGUI will move off screen too.


Any suggestions?
Thanks in advance.







will_brett

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 40
    • View Profile
Re: Issues with Vuforia
« Reply #1 on: September 17, 2013, 11:50:29 AM »
Hi there,

This is certainly my field of expertise so I will take this one.

NGUI and Vuforia certainly aren't friends out of the box... and this is more to do with how AR camera works rather than NGUI so you may be better asking on the vuforia forum instead... however I use vuforia every day at work so I will do my best.

What you are trying to do is use 2 main cameras which is not advisable. First of all the AR camera is the big boy in the project and must remain the main camera. You could then remove the NGUI camera from the UI and place it under the AR camera, You will then need attach the attached script to the NGUI camera and drag the AR camera onto that script in the inspector. Then go back to your UI and disable the anchor (no need to delete it).

Make sure your UI is on the GUI layer, and that the AR camera is ignoring that layer. Then make sure the NGUI camera is only rendering the GUI layer.

You must also make sure that the UI is a 3d ui and not 2d it must be 3d to work with vuforia.

Finally make sure your camera is set to 0, 0, 0 in positioning, as it needs to follow the AR camera exactly. The NGUI camera must also have the same clipping and field of view settings as the AR camera.

Sorry that this was written so long winded but I am really busy and had to rush. Hope this helps and let me know if you get stuck or ask in the Vuforia forums :D

reis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Issues with Vuforia
« Reply #2 on: September 18, 2013, 03:52:29 AM »
Really appreciate the in-depth response. It's definitely a link I wont be getting rid of any time soon if I run into the same error. I Managed to create what I was after in the end by using the UI Wizard, and with a few alterations from the 2scene camera video for NGUI.

If I find this is insufficient for building to the device then I shall be turning straight to this answer. Thanks again.


will_brett

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 40
    • View Profile
Re: Issues with Vuforia
« Reply #3 on: September 18, 2013, 03:59:32 AM »
Glad you got it sorted. Keep hold of that script though as it is really useful when using multiple cameras in scene :)

reis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Issues with Vuforia
« Reply #4 on: September 18, 2013, 06:18:37 AM »
This is a long shot but im having some troubles integrating Prime31 Etceteria plugin with Vuforia and NGUI? all my assets are correct and I'm trying to call, take screenshot.

I have managed to get the bezel wheel active, In my previous build I was using UIToolkit and I take screenshot method was working then. I've only copied and pasted the code but when I click on the button on the iPad the screen goes black for a split second then returns to normal view. And no photo has been saved.

Know much on this subject? :)

Thanks for your help!

reis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Issues with Vuforia
« Reply #5 on: September 18, 2013, 06:45:53 AM »
Usually helps if I actually assign the take photo script to the button...

will_brett

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 40
    • View Profile
Re: Issues with Vuforia
« Reply #6 on: September 20, 2013, 05:10:15 AM »
We do use prime31 stuff at work but unfortunately I personally have never even looked at it so I would be no help at all. Just check that you aren't using multiple camera's in scene and if you are you child the camera to the AR camera and set the culling to something that the AR cam can not see. Sorry can't help more

reis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Issues with Vuforia
« Reply #7 on: September 20, 2013, 09:06:02 AM »
The UI looks great without parenting it to the AR Camera, is there a reason why you need to do this?
I've parented it just for the sake of you saying it but would like to know a reason.

Thanks!