Log in or register to post comments

QCARRuntimeUtilities.ScreenSpaceToCameraFrameCoordinates is retu

March 16, 2016 - 7:14pm #1

Vuforia SDK Version: 4.2.3 -

Description with steps to reproduce:

Unity Version 4.6.9p4

QCARRuntimeUtilities.ScreenSpaceToCameraFrameCoordinates is return 0, 0

 

 

Sources

    private QCARAbstractBehaviour behaviour;
    private UnityEngine.Rect viewportRectangle;
    private bool videoBackGroundMirrored;
    private CameraDevice.VideoModeData videoMode;

   void Start()
    {
        PublicValue.SetTexSize(1024, 1024);
        behaviour = (QCARAbstractBehaviour)UnityEngine.Object.FindObjectOfType(typeof(QCARAbstractBehaviour));
        videoMode = CameraDevice.Instance.GetVideoMode(behaviour.CameraDeviceMode);


        CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
     }

    IEnumerator RecordTexture() {
        CameraDevice cam = CameraDevice.Instance;
        cam.SetFrameFormat(pixelFormat, true);

        while (cam.GetCameraImage(pixelFormat) == null)
        {
            yield return null;
        }

        // Warping
        videoBackGroundMirrored = behaviour.VideoBackGroundMirrored;
        viewportRectangle = behaviour.GetViewportRectangle();

        // Image Target BoundingBox Screen Coords -> Camera Coords
        Vector2[] srcCorner = targets[targetFlag].GetComponent<TargetScreenCoords3>().GetScreenCoords();
        System.Collections.Generic.List<Point> srcCornerPointList = new System.Collections.Generic.List<Point>();

        // TL, TR, DL, DR
        for ( int i = 0; i < srcCorner.Length; ++i ) {
            QCARRenderer.Vec2I vec2I = Vuforia.QCARRuntimeUtilities.ScreenSpaceToCameraFrameCoordinates(srcCorner [i], viewportRectangle, videoBackGroundMirrored, videoMode);
srcCornerPointList.Add(new Point(vec2I.x, vec2I.y));
        }
......

      }

 

[Translate]

I want to change from BoxCollider coordinate of ImageTarget to vuforia image coordinate.

BoxCollider Coordinate of Image Target -> Vufoia Image Coordinate.

And Warping square.

But (Vuforia.QCARRuntimeUtilities.ScreenSpaceToCameraFrameCoordinates) is return 0, 0

srcCorner is not null, not 0, 0 -> no Problem

 

>>>>>>> In another project, the source will run without problems. <<<<<<<

 

Please help me.

-

Development OS (Mac OS X, Windows, Linux): Windows 8.1 64bit -

Mobile OS and Version: Android 4.4.2 -

Mobile Device Manufacturer and Model name: SM-T320 -

Do the Vuforia Sample Applications show the same behavior?:

Log in or register to post comments