Log in or register to post comments

Set clipping planes

June 22, 2015 - 2:49am #1

Hello everyone,

 

I am trying to change near plane and the far plane with stereo enabled but I am not succeeding since the projection matrix is only provided through the Eyewear class:

I can't get setARProjection() in my renderer to work nor Tool.getProjectionGL()

I expected some method in the Eyewear class since I get the projection matrix from it but I don't find anything, did I miss anything?

 

Thank you

Set clipping planes

July 16, 2015 - 2:57am #8

Vuforia seems to default to farClip=5000 and ignores clipping planes set on Unity Camera object. So I use this script to override it:

 

using UnityEngine;
using System.Collections;

public class CameraClippingController : MonoBehaviour 
{
    void Update() 
    {
        SetMatrix();    
    }

    void SetMatrix() 
    {
        Matrix4x4 m = camera.projectionMatrix;
        //Debug.Log (m);

        float nearPlane = camera.nearClipPlane;
        float farPlane = camera.farClipPlane;

        float c = (farPlane + nearPlane) / (farPlane - nearPlane);
        float d = -nearPlane * (1.0f + c);
        m[22] = -c;
        m[23] = d;

        camera.projectionMatrix = m;
    }
}

Set clipping planes

July 15, 2015 - 12:28am #7

OK that was what I feared but thank you.

Can someone tell if this will be added soon?

Set clipping planes

July 13, 2015 - 2:15pm #6

In Vuforia 4.2.3, there's no ability to modify the clipping planes that are used in the projection matrices returned by Eyewear.getInstance().getProjectionMatrix().

Set clipping planes

July 9, 2015 - 2:49am #5

Thanks for the help,

I managed to make it work, it seems like it was just a missing link to the libVuforia.so that didn't work.

The samples now works wonder on BT-200.

 

Good luck with your matrix problem.

Set clipping planes

July 9, 2015 - 2:26am #4

Thank you for the reply,

dm3d:

I use the Epson Moverio BT200, I ran the calibration app and the eyewear function is giving me the projection matrices with good translations/rotations, the problem is not about calibration. I will try to enlight the problem a little bit more.

In OpenGL, the far plane and the near plane (called the clipping planes) are planes that indicate to OpenGL the depth values between which it renders 3D, anything further than the far plane or anything nearer the near plane is not rendered. These values lies somewhere in the projection matrix (further information here: https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml ).

The thing is, I get the projection from the Eyewear class with (for the left eye here)

projectionMatrix = Eyewear.getInstance().getProjectionMatrix(EYEID.EYEID_LEFT);

I believe that this matrix contains more information then a traditional perspective or ortho projection matrix since it also contains the information of calibration (the translation/rotation for an eye). The problem is, since the information related to translation/rotation and the information related to projection are not separated and are in the same matrix, I cannot set well the near plane and far planes which are information only related to the projection, so modifying the matrix means possibly modifying also the translation and rotation which I do not want to.

Without the eyewear SDK, I would normally use the functions I mentionned below but it is because I get the projection matrix from the class SampleApplicationSession (the class implementing UpdateCallbackInterface) but here I get it from Eyewear, therefore I was expecting to find a method to set the clipping values in the Eyewear class.

(I hope it is a little bit clearer, don't hesitate to ask if it's not)

 

Pixsaoul:

It is really simple to get Vuforia samples working on Android Studio, I basically didn't do anything except this


Find the sample's folder and it should be fine, Android Studio is taking care of the rest. If you have any difficulties maybe you should update Android Studio? Are you sure you are using the good license key? I don't understand how you succeeded in using the normal SDK in Android Studio and not the Eyewear one sorry

Set clipping planes

July 8, 2015 - 4:58am #3

Hello,

I saw you were using the Eyewear SDK with Android Studio. I am currently trying to make it work but cannot quite find a step by step guide.

Would it be possible to have a small step by step overview on how you made it work ? So far I've used the the classic SDK on Android Studio and the Eyewear on Unity, but cannot make the Eyewear samples for Android work on Android Studio.

 

Thank you.

Set clipping planes

July 7, 2015 - 4:10pm #2

Which eyewear device are you using? Did you run through the calibration steps?

https://developer.vuforia.com/library/articles/Training/Vuforia-Calibration-App

 

Log in or register to post comments