Log in or register to post comments

when detect next image target do something (i have 2 marker)

March 24, 2014 - 7:23am #1

hi ...

 

im succes with simple move object with mesh navigation . and have problem . i want object first in first image target move to object second in image target second when image target second detected.

like this
http://adventureclubgames.com/wordpress/?p=176

if u see .. in above. there have two object. and one object be purpose when first object moving. and my problem. im save two object in two marker. but if two marker detected in ARcamera. the first object move to second object.

 

any reference ? i'll try with simple example in above. but move object not clear

 

when detect next image target do something (i have 2 marker)

May 3, 2015 - 12:58am #7

You saved a life... Thanks a lot!!

when detect next image target do something (i have 2 marker)

May 9, 2014 - 6:11am #6

Hi All, where content I must edit / make that script ??

when detect next image target do something (i have 2 marker)

March 24, 2014 - 9:33am #5

ok wait a few hours ... i'll will try .. please dont locked thread ...

 

im scare have error and question more .. okay ?

 

and thanks for you're suggest . im appreciate it .

 

(y)  ....

when detect next image target do something (i have 2 marker)

March 24, 2014 - 9:16am #4

Have a look at this article:

https://developer.vuforia.com/forum/faq/unity-how-do-i-get-list-active-trackables

This explains how you can retrieve the complete list of ALL the targets that are currently detected/tracked, and it also shows an example of how to check if  2 differnet targets are tracked at the same time.

 

when detect next image target do something (i have 2 marker)

March 24, 2014 - 8:27am #3

yes you're right .. im think use transform for solution ..

 

but for send value true or false for object to move when marker detected how ?
 

i see the code in below .

public class ImageTargetPlayAudio : MonoBehaviour,
                                            ITrackableEventHandler
{
    private TrackableBehaviour mTrackableBehaviour;
 
    void Start()
    {
        mTrackableBehaviour = GetComponent<TrackableBehaviour>();
        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterTrackableEventHandler(this);
        }
    }
     
    public void OnTrackableStateChanged(
                                    TrackableBehaviour.Status previousStatus,
                                    TrackableBehaviour.Status newStatus)
    {
        if (newStatus == TrackableBehaviour.Status.DETECTED ||
            newStatus == TrackableBehaviour.Status.TRACKED ||
            newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
        {
            // Play audio when target is found
            audio.Play();
        }
        else
        {
            // Stop audio when target is lost
            audio.Stop();
        }
    }  
}

 

but the code in above when first image detected his do something is playaudio. and how when detected object number two do something ?

 

any reference admin ?

when detect next image target do something (i have 2 marker)

March 24, 2014 - 8:12am #2

If I understand correctly what you describe, 

you should be able to do this by saving the reference frame of the first target when the second is detected, and then compute a relative transformation of one target rference frame to the other.

Based on this, you could implement the animation of the target; we don't have a tutorial for this, 

but have a look at the Unity Transform class, which provides the relevant method, to start with:

http://docs.unity3d.com/Documentation/ScriptReference/Transform.html

The rest sounds more like Unity animation programming and 3D maths.

 

Log in or register to post comments