Log in or register to post comments

Move around instantiated 3D at image target position

January 25, 2018 - 4:04am #1

Hello everyone, 

 

I need to instantiate a new gameobject at the image target position on user input (ie: tap/click). This object needs to stay static at this position and the user has to be able to rotate around the object.

The problem i'm having is that once the image target has been detected and the new object is instantiated two things can happen: 

 1) World center mode: First target -> The object moves with the image target -> i dont want that.

 2) World center mode: Camera -> The object moves with the camera -> i dont want that neither.

 3) World center mode: Device tracker -> Same as camera :S. 



 

I've been searching for hours and i can' see the solution. Could anyone please give some advice? 

Thank you in advance

 

 

Ps: sorry for the duplicated post,  idk what happened

Move around instantiated 3D at image target position

February 2, 2018 - 9:59am #9

Also tried with Extended tracking in Vuforia and it happens the same, doesnt matter the model dimensions, the center should be always at the same place, above the image target, but changes as you move a little, always near the target image but clearly in different positions. Tried with ipad pro and with samsung s8

Move around instantiated 3D at image target position

February 2, 2018 - 6:47am #8

I didnt try a big model in arkit, but i saw that small models also jitter a bit sometimes. I cant send a video but its just a big model where i put a tall cube that is in the center of the model so that i can see if the center always stays at the texture. I see that when i start moving around the tall cube doesnt fit in the texture anymore, seems like the model is not well anchored. When i tried with the astronaut to human size it looked fine but with much bigger objects the center moves, seems like the bigger is the item the anchoring errors are more noticeable. I am just in an office with many things around so there should be enough detail around but the ground which is just made of wood, it has some detail.

Move around instantiated 3D at image target position

January 29, 2018 - 7:32am #7

Sorry I confused you were the other person in this thread.  If you are sure your device supports ARKit then you there's nothin to do, it will use it automatically.  If you think the quality of the anchoring isnt what it should be, maybe post a video and we can tell you if it's in reason.  Even ARKit will not be absolutely perfect.  The more detail in the camera view the better the tracking.  Try adding a bunch of miscellaneous physical items to your camera view to see if it helps.  This would tell you if it's something you are doing or just the nature of the technology.

Move around instantiated 3D at image target position

January 29, 2018 - 6:21am #6

I have an ipad pro that can be used with arkit, i used already arkit, how can be used arkit with vuforia?

Move around instantiated 3D at image target position

January 26, 2018 - 10:16am #5

From just your description, I think this is more of a limits of the technology than something you can do.  There's two kinds of anchoring built into Vuforia, their own implementation and a version that's built on top of ARKit.   Using a device that supports ARKit (and soon, ARCore) will offer better quality anchoring.  



 

Move around instantiated 3D at image target position

January 26, 2018 - 7:53am #4

It works but when you move and see the model again sometimes it readjust the position a little to fit in the right position, i would like to know how to make the model not move at all  or at least that is not so noticeable

Move around instantiated 3D at image target position

January 25, 2018 - 6:40am #3

Hello dpizzle,

Thank you for your help!!

I see, so i need to set an anchor (like a world anchor) and then place my content inside. Fair enough! 

Unfortunately my testing device is a Redmi 4x (not supported), im going to try just in case.

I will post the outcome



Thanks again! 

 

Move around instantiated 3D at image target position

January 25, 2018 - 6:13am #2

Sounds like you need to combine ground plane and image targets.  You'll need to handle it in code.  When the image target is found, you'll set a ground plane anchor.  Follow the tutorails on ground plane and then replace DefaultEventTrackable with something like this on your image target. Note that groundplane is brand new and only compatible with some device.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;

public class MyDefaultEventTrackable : DefaultTrackableEventHandler {

public Camera ARCamera;
public PlaneFinderBehaviour planeFinderBehaviour;
public GameObject groundPlaneStage;

bool groundPlaneSet = false;

protected override void OnTrackingFound()
{
  base.OnTrackingFound ();
 
  if (!groundPlaneSet)
  {
   Vector3 screenPos = ARCamera.WorldToScreenPoint(gameObject.transform.position);
   planeFinderBehaviour.GetComponent<PlaneFinderBehaviour>().PerformHitTest(new Vector2(screenPos.x,screenPos.y));
   groundPlaneStage.transform.SetPositionAndRotation(gameObject.transform.position,gameObject.transform.rotation);
   groundPlaneSet=true;
  }
 
}
}

Log in or register to post comments