I'm working on 3D digitizing using a Vive controller. I'm using OpenVR to talk to the hardware and PollNextEventWithPose
to get the controller's pose at the time the user pressed a button. From the pose, I want to calculate a point that's 177mm along the Z axis where our digitizing point is.
Running under Unity, I did something like this:
var digitizerPosition = trackedObject.transform.position - trackedObject.transform.forward * 0.177f;
Now under OpenVR, PollNextEventWithPose
gives me a TrackedDevicePose_t
which contains the field mDeviceToAbsoluteTracking
which is of type Valve.VR.HmdMatrix34_t
. Given that matrix, how do I calculate a point along the Z axis?