Page 1 of 1

How to rotate a rigid body by changing the Euler angle

Posted: Tue Jun 23, 2020 2:11 am
by water
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);

Code: Select all

	glRotatef(trans.getRotation().getW(), trans.getRotation().getX(), trans.getRotation().getY(), trans.getRotation().getZ());