Log in or register to post comments

Buttons Appear on AR found.

March 4, 2012 - 10:58pm #1

In a scene where i have multiple markers, and thus multiple models.
How do i make buttons appear depending on the AR model that is showing ?

for example when model 1 shows, i only want to see button A.
when button 2 shows, i only want to see button B (A has no function for model 2)
and so on...

and if so, as a second question, i was wondering if there is a way to make the "detection" trigger something.
for example, i want the buttons to slide into the screen, instead of just popping up.
but somehow the detection of the marker, should trigger the sliding process.
can this be done ?

Re: Buttons Appear on AR found.

April 20, 2012 - 6:40am #7

Have you got this working?

A simple approach would be to assign the button object as a child of your model, or a GameObject encapsulating your model. Then execute your animation from the Trackable's event handler - either the Default Trackable Event Handler, or a custom event handler that you write.You could use an Animation component, or animate the button procedurally.

Re: Buttons Appear on AR found.

April 20, 2012 - 2:27am #6

never mind, found something. working that out

Re: Buttons Appear on AR found.

March 5, 2012 - 2:26pm #5

ahaa i think i understand. i'll give it a go tomorrow.

sorry for not being more clear, i thought Unity was almost standard in combination with Vuforia, therefore forgot to mention.

Re: Buttons Appear on AR found.

March 5, 2012 - 8:13am #4

(Your generic use of the word 'scene' in the iOS forum wasn't sufficient for me to guess you are using Unity...)

Look at the QCARManager script - the Update() method calls UpdateTrackers() which monitors the detected status.

You can use the same state, or create your own state property, then your UI script can use that state to decide what buttons need to be drawn.

Re: Buttons Appear on AR found.

March 5, 2012 - 7:31am #3

But in that case you make them within Xcode and not in Unity ?

I had already set up some buttons within unity, so that way i can link the button actions to the model.
Or is that what i am suppose to do, except making them show/hide in Xcode ?

Mm a bit into coding with JS and C#, but not yet in Xcode. you'd you explain a bit more please?
Thank you very much in advance.

Re: Buttons Appear on AR found.

March 5, 2012 - 3:59am #2

Hi BallastAR,

The recommended way is to have the buttons already created and hidden in the view hierarchy (put them as younger siblings of the EAGLView not as children). If you're using QCAR 1.5 then you could add another view between the AR view and the overlay view.

Then in renderFrameQCAR you'd implement some logic to trigger a 'detected' state, and call a method on the main thread that unhides the buttons.

To rehide the buttons maybe use a timeout, so that when the trackable hasn't been seen for a set period you can rehide the buttons.

Log in or register to post comments