Topic locked

When in AR-scene,the fullscreen GUI will out of the screen.

November 3, 2011 - 1:23am #1

I created a Javascript to load the Screen's width and Height let GUI will full of the screen. It's Normal in Unity's Scene,but it will out of screen range with AR's Scene. full screen GUI's JS

function Start () { guiTexture.pixelInset = Rect (0, 0, Screen.width, Screen.height); } function Update () { }

in Unity3D's Game View On Device (Nexus One) Normal U3D Scene On Device (Nexuse One) AR scene On other Device have this problem too. On HTC flyer just a little out of range better than Nexus one,but on SAMSUNG Galaxy S I9000 it's ........... Thanks and sorry for my English.

When in AR-scene,the fullscreen GUI will out of the screen.

June 20, 2014 - 5:41am #5

Hi VGSIprog ,

the issue you are observing with GUITexture is connected to the use of the VideoPlayback feature and is discussed in this thread:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/guitexture-aspect-ratio-gets-stretched-during-texture-v

Please follow up in that thread, where the solution is also provided.

 

When in AR-scene,the fullscreen GUI will out of the screen.

June 18, 2014 - 10:51am #4

ksiva, we're currently on vuforia for unity 2.8.13 with unity pro and have the GUITexture stretch issue; where all GUI textures get stretched and displaced if we are to play a videoplayback on texture.

It ruins our user interface quite a lot.

 

The suggestion to alter TrackerBehaviour.cs seems like a good way to go, but it doesn't seem to be available at all on later vuforia versions.

 

Is there anything we can do to solve the problem?

 

Regards,

Re: When in AR-scene,the fullscreen GUI will out of the screen.

November 4, 2011 - 12:11pm #3

Thanks,Kim!
But I have no Device now,it has provided for a design competition.
I will try it when the device receives a new's.
Maybe in a week,then tell you the test results.

Thank you again.

Re: When in AR-scene,the fullscreen GUI will out of the screen.

November 3, 2011 - 2:22pm #2

This is an issue that will be fixed in our next release. You should be able to fix it yourself with a couple small modifications to the TrackerBehaviour.cs script (found in the Qualcomm Augmented Reality/Scripts folder).

Remove the OnPreRender method:

    //void OnPreRender()
    //{
    //    // Don't set the viewport when running in the editor:
    //    if (!Application.isEditor)
    //    {
    //        GL.Viewport(mViewportRect);
    //    }
    //}

Update the InitializeProjection method:

    private void InitializeProjection()
    {
        float[] projMatrixArray = new float[16];
        IntPtr projMatrixPtr = Marshal.AllocHGlobal(
                    Marshal.SizeOf(typeof(float)) * projMatrixArray.Length);

        getProjectionGL(camera.nearClipPlane, camera.farClipPlane,
                            projMatrixPtr, (int)Screen.orientation);

        Marshal.Copy(projMatrixPtr, projMatrixArray, 0, projMatrixArray.Length);
        Matrix4x4 projectionMatrix = Matrix4x4.identity;
        for (int i = 0; i < 16; i++)
            projectionMatrix[i] = projMatrixArray[i];

        if (mViewportRect.width != Screen.width)
        {
            float viewportDistort = mViewportRect.width / Screen.width;
            projectionMatrix[0] *= viewportDistort;
        }

        if (mViewportRect.height != Screen.height)
        {
            float viewportDistort = mViewportRect.height / Screen.height;
            projectionMatrix[5] *= viewportDistort;
        }

        print("projection:\n" + projectionMatrix);

        this.camera.projectionMatrix = projectionMatrix;

        Marshal.FreeHGlobal(projMatrixPtr);
    }

Let us know if that helps.

- Kim

Topic locked