Log in or register to post comments

How to replace Multitarget Mesh in render

August 13, 2013 - 8:00am #1

Hello

Im Trying to get into Vuforia and are playing around in the Multi Target Example. Is it possible to hide the rendered Target(the cornflakes box or display another object on the position on screen) In reality there is the cornflakes box, but on screen there is a much bigger box looking different one. I cant hide the virtual cornflakes box the render components are grayed out.

How to replace Multitarget Mesh in render

August 15, 2013 - 6:59am #8

No problem, we're all learning :)

N

How to replace Multitarget Mesh in render

August 15, 2013 - 6:02am #7

Thank you very much. Im not so new to unity, but to script more complex things  i just need  a lot more practice...

How to replace Multitarget Mesh in render

August 15, 2013 - 5:48am #6

GameObject.Find("name of object") normally works.

http://docs.unity3d.com/Documentation/ScriptReference/GameObject.Find.html

If you are new to Unity, it's worth checking out the Learn Unity Section to understand the basics

http://unity3d.com/learn/tutorials/modules

..which should not take too long to go through.

 

N

 

How to replace Multitarget Mesh in render

August 15, 2013 - 5:41am #5

Thank you very much, I know this is more of a unity/ C# question, but maybe you can help: Do you have a suggestion how i could access specific Child with a specific tag to exclude it from the foreach component.enable loop?

How to replace Multitarget Mesh in render

August 15, 2013 - 4:30am #4

But I’m still asking myself how I could toggle off the render component of a Multitarget Hierarchy child

If you mean you want to turn each individual face off in the MT then this is not possible.

If you mean you have separate children attached to the MT object, then these are controllable by customising the DefaultTrackableEventHandler script in the OnTrackingFound/Lost methods.  As shown below, all they do at present is switch the renderer/collider components on/off.

Any Ideas of how i con Toggle on an of some kind of “AR info objects” being attached to the Model with a button

You would need to customise these methods based on finding the "AR Info object" and then activating/deactivating it accordingly.

 

N

 

 

    private void OnTrackingFound()

    {

        Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(true);

        Collider[] colliderComponents = GetComponentsInChildren<Collider>(true);

 

        // Enable rendering:

        foreach (Renderer component in rendererComponents)

        {

            component.enabled = true;

        }

 

        // Enable colliders:

        foreach (Collider component in colliderComponents)

        {

            component.enabled = true;

        }

 

        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");

    }

 

 

 

 

How to replace Multitarget Mesh in render

August 15, 2013 - 3:15am #3

I have solved the main Problem. The Multi Target of the example was just too big, I have created a new smaller one and moved it into the Model and the Model is replacing the "Real Box" correctly.

But I’m still asking myself how I could toggle off the render component of a Multitarget Hierarchy child, because on runtime every child’s render component is set to true automatically one the target comes in view. Sadly “Gameobject.active=true/flase” doesn’t work too, in order to toggle the visibility of child’s of multitarget

Any Ideas of how i con Toggle on an of some kind of “AR info objects” being attached to the Model with a button, off course only if the Model/Multitarget itself is in view?

How to replace Multitarget Mesh in render

August 14, 2013 - 8:46am #2

Hi, the question is not so clear; could you explain it a bit more in detail?

 

Log in or register to post comments