Log in or register to post comments

Vuforia tracking problem with Unity 4

October 28, 2013 - 2:49am #1

Dear Vuforia Team,

We are developing an application with uses the Vuforia Plug-in for Unity3D to render animated 3D objects over certain markers (frame and image targets).
After loading the objects from an AssetBundle, instantiating them and assigning to the correspondent markers, we realize that the markers are not being tracked correctly.
Attached are screenshot with the examples and the code used to load and assign the objects.
Code to load and assign objects:
 

GameObject FM0 = GameObject.Find("FrameMarker0");
if (bundle.Contains("FMObj0")) {
   GameObject FMO_0 = bundle.Load("FMObj0", typeof(GameObject)) as GameObject;
   inti0 = (GameObject)Instantiate(FMO_0);
   inti0.transform.position = FM0.transform.position;
   inti0.transform.parent = FM0.transform;
}

Besides this we would like to ask, if it is possible to load and instantiate an already pre-configured image target from an AssetBundle.
For us its known, that we can create image targets on runtime as long as the image sources are in the assets of the project.
This is however not an solution for us, then this AssetBundles should contain a whole scene by his own -packages are downloadable-.
The idea is not to call GameObject.Find, but to Bundle.Load the markers together with the assigned object. Is this possible?

We would appreciate every kind of help and comments. Thank you.

Best regards,
Róbert Bednárik

AttachmentSize
Image icon Screenshot_1.png369.63 KB
Image icon Screenshot_2.png374.54 KB

Vuforia tracking problem with Unity 4

October 31, 2013 - 12:31am #4

The idea is not to call GameObject.Find, but to Bundle.Load the markers together with the assigned object. Is this possible?

I think what they try to do is to avoid to have the prefabs in the scene before initiation. They want to load the GameObjects AND FRAMEMARKERS/IMAGEMARKERS from the assetbundle directly and not from the scene.

Am I right?

EDIT: I found out that the "World Center Mode" in the ARCamera has to be in FIRST_TARGET and not CAMERA for the Vuforia PlugIn to track the Objects correctly. This answers the wrong tracking question, but not the Markers loading problem.

Vuforia tracking problem with Unity 4

October 29, 2013 - 5:43am #3

The idea is not to call GameObject.Find, but to Bundle.Load the markers together with the assigned object. Is this possible?

I think what they try to do is to avoid to have the prefabs in the scene before initiation. They want to load the GameObjects AND FRAMEMARKERS/IMAGEMARKERS from the assetbundle directly and not from the scene.

Am I right?

 

Vuforia tracking problem with Unity 4

October 28, 2013 - 3:58am #2

Hi, 

I think the issue may be with the local origin and orientation of the reference frame of the assets in your asset bundles, not in the tracking of the Frame Markers.

You can verify this by attaching a simple Cube to the Frame Markers.

So, you will probably need to add some additional translations and/or rotation and/or scaling to the root of your AssetBundle scene.

 

Log in or register to post comments