Log in or register to post comments

Setting and Getting Projection Matrix

July 8, 2015 - 3:34am #1

Eyewear: bt200

IDE: Unity Engine.

SDK: Vuforia Eyewear SDK 4.2.3

I have been trying to set the projection matrix for just one eye when I encountered, what appears to me, to be a rather strange behaviour. The same behaviour was observed for both eyes. In the following code, I have attempted to set the projection matrix for the right eye.

Here is the relevant code snippet,

using UnityEngine;
using System.Collections;
using Vuforia;
using UnityEngine.VR;
using System;
public class ProjectionModifier : MonoBehaviour {

	Eyewear eyeWearInst;
	EyewearCalibrationProfileManager calibManager;

	void Start () {
		calibManager= eyeWearInst.getProfileManager();
		Matrix4x4 IdentityMatrix=Matrix4x4.identity;
		calibManager.setProjectionMatrix (calibManager.getActiveProfile (), Eyewear.EyeID.EYEID_RIGHT, IdentityMatrix);

	void Update () {
		PrintRightProjectionMatrix ();
	void PrintRightProjectionMatrix(){
		Matrix4x4 projMat=calibManager.getProjectionMatrix (calibManager.getActiveProfile (), Eyewear.EyeID.EYEID_RIGHT);
		Debug.Log ("Right Projection Matrix :\n " + projMat.ToString ());


Each time I ran the code, the printed projection matrix was different [see attachments] and was never the identity matrix that I was trying to set.

I know this is irrelevant, but just in case, I ran the code with the glasses fixed on the table, with no changes to the scene and there were no image targets in the camera view.

Any idea why?



Image icon Run_1.png6.98 KB
Image icon Run_2.png8.66 KB
Image icon Run_3.png7.37 KB
Image icon Run_4.png7.77 KB

Setting and Getting Projection Matrix

August 31, 2016 - 5:57am #4

I am trying to access Vuforia method: Eyewear.GetProjectionMatrix(EYEID) within Unity. I would be very glad if you could explain how you have managed that !



Setting and Getting Projection Matrix

July 27, 2015 - 3:27am #3

To answer your first question, no, the device was not being recalibrated between individual runs.

If I only read the projection matrices, before trying to set them, then they look all right and are consistent.

Meanwhile, I found a work around by reading the matrix through Vuforia's Eyewear.GetProjectionMatrix method, and using Unity's Camera object to set the matrix.

Seems to work fine now.



Setting and Getting Projection Matrix

July 14, 2015 - 5:15pm #2

Is the device being re-calibrated on each of those runs? If you don't set the projection matrix, what are the return values and are they consistent across runs?

Log in or register to post comments