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:

Matrix Transformation Question - Processing 2.x and 3.x Forum

Matrix: after translate/rotate in P3D: can we save the Matrix other than with pushMatrix()? - Processing 2.x and 3.x Forum

Kf