Start a new topic

Initial findings re augmentation stability / alignment

Initial findings re augmentation stability / alignment


I am finding that some / all of my 3D models that appear when in FOV jitter about a lot.  I have set extended tracking on as well as set contiuos focus but still there is jitter.



public WikitudeCamera wikitudeCamera;

void Start() {
   wikitudeCamera.FocusMode = (CaptureFocusMode)2;
}



I also find that the colliders I have set on my GameObjects are offset considerably so if you imagine the object has a sphere collider then tapping on it anywhere in this region should work.  But I have to tap outside of the GameObject to get the colliders to trigger?

I use this to detect touches:

Ray ray = Camera.main.ScreenPointToRay (touch.position);

But I see the wikitudeCamera has two cameras assigned to it, canvas and scene.  I am not sure if Camera.main is pointing to the correct camera and has thus far failed to reference the scene one without compiler error? 

 

 

Hi,

Does the jitter also happen when building the example app? Maybe the target images don't have sufficient quality. You can check this in the target manager, where each target image has a number of stars. Extended tracking doesn't help with the jitter, but only with tracking targets after they exit the field of vision.

Regarding the camera, you can change the Camera.main to point to WikitudeSceneCamera by changing the tag from "Untagged" to "MainCamera", and switch the WikitudeCanvasCamera to "Untagged" (Unity Docs). However, I'm not sure this will work, because we assign a custom projection matrix to the scene camera at runtime and Unity sometimes gets confused about that. Please let me know if it works or not for you, but we hope to address this issue as well soon.

Could you also post the compile error that you are getting? I would like to take a look at that as well.

Best regards,
Alexandru

I have not yet built the sample app and deployed to device to check, but I will...

For now in answer to your qustions:

The images have 3 stars so do not think it is that.

Extended tracking yeah I know, but you know how it is ... try everything ;-)

As I am doing direct comparison of my existing app developed with the other solution I can see how they compare and so can see a difference.

I will try the suggestion re the camear tags but if you think this will not work could you say is it actually possible to interact with 3D models in AR scenes?  Currently all my AR app I develop I provide user interaction via colliders and raycasts so it is something I would need to make wikitude a viable alternative?

The error was "Static member UnityEngine.Camara.main cannot be accessed with an instance reference qualify it with a type name instead" After I tried to assign WikitudeSceneCamera to a variable named cam and then tried Ray ray = cam.main.ScreenPointToRay (touch.position);

 

Hi,

I don't know if it will work or not, since I don't know exactly how Unity computes ScreenPointToRay. I haven't tested this myself, but I will. User interaction is very important and we will try to fix all the issues as soon as possible.

Regarding the compile error, cam.ScreenPointToRay should work, you don't need the "main" part.

Hi again, 

I've done the test and SceenPointToRay works correctly if you use WikitudeSceneCamera. So interaction with augmentations should be possible. In my test I changed the color of the eye when tapping on it. If you have any more issues, please let me know.

Best regards,
Alexandru

A few points..

Did you simply change the tags on the canvas and scene camera to get this to work?

I have a number of 3D objects a children of the main traker so I can attach just one toggletracking script.  I also have a canvas that displays when tracking is lost but am having issues as even though I have the child objects set in the editor the same as the canvas items the objects appear but the canvas remains even though in the on enter fov function I set to false?

Another problem I am finding is the positioning of objects dependant on device as folllow:

With Vuforia running on iPad and Galaxy Tablet and then on iPhone 6+ and Samsung S6 the relative positions of the objects remain the same across devices.

With Wikitude the same is no so as when vieing on iPhone and S6 they are offset and seem too big?

 

Hi, 

Yes, just switching the tags should be enough. This is how the prefab will be by default in future versions.

About the other two issues, would it be posible for you to post some screenshots of the hierarchy for the first issue and of the objects on both devices to illustrate the difference in offset and size? It would help me better understand your problems.

Thanks,
Alexandru

can we share the pics via email please?

Sure. You can send an email at support wikitude.com.

Hi,

I have found out why my taps were not working at all.  It is because I have code in place to detect if a tap is on a UI element thus blocking the raycast propagating through to any 3D object beneath it.

It appears that the WikitudeCanvasCamera is causing this problem for me.  I have tried without success disabling all or part of it but it just breaks the app completely.

There are situations where I provide UI buttons to the user whilst 3D augmentations are running which in themselves have colliders and code attached therefore I need to stop touches passing through when a UI element is tapped.

Hi, 

What issues does the WikitudeCameraCanvas cause? Have you tried using the Unity UI System, as it doesn't use / need any colliders?

Best regards,
Alexandru

see this sentence:

"There are situations where I provide UI buttons to the user whilst 3D augmentations are running which in themselves have colliders and code attached therefore I need to stop touches passing through when a UI element is tapped."

UI elements are for ...UI...I use colliders on the actual 3D models being augmented so the user can interact with them.  Therefore if at any time that the augmentation is visible and the UI button is in front of it when the user taps the UI button the touch passes through the the 3D object...not good.

This is a standard setup I believe in Unity whereby developers stop the UI touches passing through to the objects in the scene

 

 

I see. How are you detecting if a tap is on the UI? I've tried EventSystem.IsPointerOverGameObject and EventSystem.currentSelectedGameObject and they seem to work for me.

Like this:

    void Update () {

        if (Input.touchCount > 0) {

            Touch touch = Input.GetTouch (0);
        
            if (touch.phase == TouchPhase.Began) {

                tappedUI = false;

                if (EventSystem.current.IsPointerOverGameObject(touch.fingerId)) {

                    tappedUI = true;
                }
                    
                tapComplete = false;
            } 
            else if (touch.phase == TouchPhase.Ended) {

                tapComplete = true;
            }

            if (tapComplete && !tappedUI) {

                Ray ray = Camera.main.ScreenPointToRay (touch.position);

                RaycastHit hit;

                if (Physics.Raycast (ray, out hit)) {

                    switch (hit.collider.gameObject.name) {

                    case "BarButton":

                        bars.SetActive (true);

                        lines.SetActive (false);

                        break;

                    case "LineButton":

                        lines.SetActive (true);

                        bars.SetActive (false);

                        break;

                    case "TextButton":

                        if (bars.activeSelf) {

                            barsText.SetActive (!barsText.activeSelf);
                        }

                        if (lines.activeSelf) {

                            linesText.SetActive (!linesText.activeSelf);
                        }

                        break;

                    default:

                        break;
                    }
                }
            }
        }
    }

This is how I currently having it working under Vuforia

 

Hi, 

On the "Canvas" GameObject that is a child of the "WikitudeCanvasCamera", can you please try to remove the "Graphic Raycaster" component? It doesn't need to be there anyway, and I will remove it in the next update. It may help with your issue.

Thanks,
Alexandru
Login or Signup to post a comment