Get orientation in VR mode?

Hey everybody!

I’d like to get whatever my orientation is while in VR mode. I don’t mean just landscape or portrait but the exact azimuth, e.g. -PI to PI.

I know how to get my orientation via the compass example, but the sensors are allready being called upon in VR mode, so I don’t think I should call upon them again. I’ve been combing through the library files without luck.

I’ve written code that allows the user to walk through a VR environment, but I need the current orientation so that, for example, the UP key always moves the user forward.

Anybody know? Thanks in advance!

Think I got it.

import processing.vr.*;

PMatrix3D eyeMat = new PMatrix3D();

void setup() {
  fullScreen(STEREO);
}

void draw() {

  getEyeMatrix(eyeMat);
  println(eyeMat.m00);
  
} 

Maybe these next posts are relevant:

https://forum.processing.org/two/discussion/13723/matrix-transformation-question

https://forum.processing.org/two/discussion/23780/matrix-after-translate-rotate-in-p3d-can-we-save-the-matrix-other-than-with-pushmatrix

Kf