How to rotate a rigid body by changing the Euler angle

Post Reply
water
Posts: 33
Joined: Fri Jun 05, 2020 8:36 am

How to rotate a rigid body by changing the Euler angle

Post 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);
	groundTransform.setRotation(quaternion);

Code: Select all

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

Post Reply