I wonder how to rotate an object around its Y axis.
For example, I would like to rotate the droid bot of the Google sample app hello_ar_java https://github.com/google-ar/arcore-android-sdk/tree/master/samples/hello_ar_java around its Y axis with an angle alpha.
I recently had to do something similar. In the object renderer's draw method you can add:
Matrix.translateM(mModelMatrix, 0, x, y, z);
Matrix.rotateM(mModelMatrix, 0, rotationAngle, 0f, 1f, 0f);
Matrix.translateM(mModelMatrix, 0, -x, -y, -z);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With