Retrieve the rotation angle of the clicked object

Hello, when I click on an object I would like to get information about its orientation…
Unfortunately with this command I don’t get the right number “pointerInfo.pickInfo.pickedMesh.absoluteRotationQuaternion”
or
“pointerInfo.pickInfo.pickedMesh._absoluteRotationQuaternion”

what would be the expected result? It does deliver the object’s absolute orientation (when referencing the var without the _)

ground.rotation.y = 2; so i want pointerInfo.pickInfo.pickedMesh.absoluteRotationQuaternion._y = 2 ?

you are getting a quaternion, which is not the euler angles that you defined. you can simply get the .rotation variable of the pickedMesh, but this is not guaranteed to always be defined. You can also convert the quaternion to euler angles:

Retrieve the rotation angle of the clicked object | Babylon.js Playground (babylonjs.com)

2 Likes

Thank you very much for your help

1 Like