When getting input from my VR controllers, I can use the following code to draw a box at the left controllers position:
let left = getXRInput(LEFT);
push();
translate(left.position.x, left.position.y, left.position.z);
box(0.05);
pop();
I would also like to get the rotation angles around the global x, y, and z-axis. Unfortunately, due to things I need to do beyond drawing something with the controller's orientation and position, I cannot use the applyMatrix function. I have tried using the upper left 3x3 elements of the left.pose matrix (which I understand to be the rotation matrix) by converting this to euler angles. I have not been able to get the correct data by doing this though. Is there something I could call like left.rotation.x or some manipulation I could do to the matrix data to get these values?
Nature of issue?
Which area does this problem relate to?
Feature enhancement details:
When getting input from my VR controllers, I can use the following code to draw a box at the left controllers position:
let left = getXRInput(LEFT); push(); translate(left.position.x, left.position.y, left.position.z); box(0.05); pop();
I would also like to get the rotation angles around the global x, y, and z-axis. Unfortunately, due to things I need to do beyond drawing something with the controller's orientation and position, I cannot use the applyMatrix function. I have tried using the upper left 3x3 elements of the left.pose matrix (which I understand to be the rotation matrix) by converting this to euler angles. I have not been able to get the correct data by doing this though. Is there something I could call like left.rotation.x or some manipulation I could do to the matrix data to get these values?