Log in or register to post comments

User Defined Targets: button without all the GUI stuff

April 8, 2013 - 12:50pm #1

Hi, 

 

I've noticed there's quite a lot of topics around User Defined Targets, but I haven't yet found the stripped down version I'm looking for. 

I really like the feature and would to add it to my app. 

 

However, even using the Unity prefabs, it's quite complicated to discover the actual script to initiate a scan, because of the massive amount of code to draw the GUI for all screen sizes and orientations. 

I managed to replicate the example in my own project, but now I'm faced with a bunch of UI elements which I don't want to use. 

 

I'm using NGUI to create my GUI - so what I'd really like, is to simply apply a script to a button which starts the scanning procedure and another one which creates the new target. The green viewfinder (and accompanying scripts) is a nice and useful feature, but I wouldn't mind if it just doesn't work on low detail targets. The less the better. 

I realise this might be a bit too simplistic, but even narrowing it down to a centered square button would be very helpful! 

 

Thanks in advance

 

User Defined Targets: button without all the GUI stuff

January 28, 2014 - 7:09am #7

You could try to rename the UI classes of the Vuforia samples, as suggested in that thread; this could be a bit tedious, but would solve in the meantime...

User Defined Targets: button without all the GUI stuff

January 28, 2014 - 6:30am #6

Hi NalinS,

Thanks for the heads up, however I can't update until the issue with namespace is solved I am having to stick to an older version https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/287-namespace-conflict-ngui

Thanks

S

User Defined Targets: button without all the GUI stuff

January 28, 2014 - 6:23am #5

If you download the latest UDT sample for the latest SDK you will find that it is much streamlined.

Maybe this could help you?

 

N

User Defined Targets: button without all the GUI stuff

January 27, 2014 - 9:16am #4

Was a work around ever found for this issue? 

I'm also working with NGUI and want to bypass the default GUI actions and buttons. 

By default my NGUI UI Root works fine, an extra buttons which is setup to take screenshot works and ignores the NGUI layerm, but the standard UI still remains in the shot. I believe the answer is related to this thread. 

User Defined Targets: button without all the GUI stuff

April 17, 2013 - 1:28am #3

Hi - thanks for your reply. 

 

I'm new to C#, so still getting up to speed with its concepts. 

 

As I understand the added value of the image-quality-brackets, I wouldn't mind (or actually, would be happy) using these. 

So to narrow down my question; I would like to know how I can replace the images used in the sample GUI with buttons I created with NGUI (which are basically game objects which have a void OnClick event). Reason being my existing GUI - which already takes care of all screen scaling - interferes with the one from the example. 

Or to put it in another way; how would I fire the buildTarget action (e.g.) from outside the existing UI script. 

I'm guessing it is something in the area of 'return ButtonID.BUILD_TARGET_PRESSED' within UserDefinedTargetBuildingUI, but it's all so intertwined I'm struggling a bit to find the exact location to tweak this (without breaking anything). 

 

I realise this might be a bit of an exhausting question, so please do let me know if I need to specifiy further. 

 

Thanks again, 

 

User Defined Targets: button without all the GUI stuff

April 8, 2013 - 5:04pm #2

Control of the scanning state and target building is demonstrated in UserDefinedTargetEventHandler.cs. This is also where the UserDefinedTargetBuildingUI and ScanModeUILogic are instantiated, and where you can disable them, though it could be helpful to adapt ScanModeUILogic rather than remove it as it provides useful methods for handling changes in frame quality and also UI states.

The thing to keep in mind regarding UDT is that it requires that the quality of the captured camera frame is sufficient to generate a trackable target image. It will reject inviable target images. So your UI logic needs to accommodate changes to the frame quality, which are provided through a callback ( OnFrameQualityChanged(ImageTargetBuilder.FrameQuality frameQuality ). This is what's demonstrated by the white -to- green corner brackets.

Log in or register to post comments