How to rotate a rigid body by changing the Euler angle
Posted: Tue Jun 23, 2020 2:11 am
I set up a rigid body, and I hope that I can change his rotation by changing his Euler angle through the keyboard, and display him through OpenGL. What should I do?
Code: Select all
btQuaternion quaternion = btQuaternion(yaw, pich, roll);
groundTransform.setRotation(quaternion);
Code: Select all
glRotatef(trans.getRotation().getW(), trans.getRotation().getX(), trans.getRotation().getY(), trans.getRotation().getZ());