How to get position of headset
Issue #6
new
I have no idea how to get the position of the headset. The documentation doesn't say.
I have no idea how to get the position of the headset. The documentation doesn't say.
You need to import this library at the start of your processing and then define a mat4 or mat4 array
import glm.mat._4.Mat4;
Mat4[] Positions;
//or Mat4 hmdPos;
And then define this in the draw loop. This will get you the whole transformation matrix of all available devices of which index 12, 13, and 14 are the positions (even though they should be 3, 7, 11 if you follow matrix logic)
////////////// hmd coords ///////////////
// vive.hmdPose.toFa(posearray);
Positions = vive.mat4DevicePose;
Positions[0].toFa(posearray); //Position0 is hmd, others are controllers
x = posearray[12];
y = posearray[13];
z = posearray[14];
I was also frustrated and found your question with no answer :(