openvr icon indicating copy to clipboard operation
openvr copied to clipboard

3D view not well formed

Open rafaloz opened this issue 9 years ago • 3 comments

Hello,

I'm integrating the vive in another platform. To do so, i get the position and orientation of each eye of the vive and translate this results into two cameras of my application. I use an image from the application, I render it to a texture, and that texture is submited to the vive, and it works but......

So for what i expected, with the cameras on the right position I would be able to create the 3D experience, but when you tilt your head or the elements of the image are far, the 3D image breaks into the left view and the right view. In other situations I can see the 3d image.

Any idea why this is happening?

`

    hmdPose = UpdateHMDMatrixPose(); //waitgetposes and get the HMDPose matrix
matposleft = GetHMDMatrixPoseEye(vr::Eye_Left);  //get the eye to head transform
matposright = GetHMDMatrixPoseEye(vr::Eye_Right);

    matcameraLE = matposleft*HMDPose; //my camera matrix
matcameraRE = matposright*HMDPose;

PoseRE = GetPosition(matcameraRE);
RotationRE = GetRotation(matcameraRE); 
PoseLE = GetPosition(matcameraLE);
RotationLE = GetRotation(matcameraLE);

`

rafaloz avatar Mar 28 '17 09:03 rafaloz

Generally, check the order of your matrix multiplications. You are probably doing "EyeTransform * HeadPose * Projection" instead of HeadPose * EyeTransform * Projection"... that would result in the object breaking apart when doing a "roll" (tilting your head sideways).

kalmiya avatar Apr 04 '17 08:04 kalmiya

Thanks for your answer! very helpful!

rafaloz avatar Apr 05 '17 15:04 rafaloz

Any ideas of closing this, now that matrix multiplication has been explained to you?

TheWhiteAmbit avatar Apr 06 '17 18:04 TheWhiteAmbit