PDA

View Full Version : rotate around world axis



lzy1g1225
02-16-2016, 12:57 AM
hi, I am using glm library for model rotation by using quaternion.But it rotate around its own axis.How can I rotate it around the world axis?

Carmine
02-16-2016, 11:15 PM
I am using glm library for model rotation by using quaternion.But it rotate around its own axis.How can I rotate it around the world axis? This question comes up often, so I posted some sample code that might help you. But you'll have to modify it to use glm and/or quaternions (which are not necessary). You can find my code HERE (https://www.opengl.org/discussion_boards/showthread.php/198179-Fixed-Pipeline-Axis-Relative-Rotations?p=1281448#post1281448). I believe that what you are asking for ('world axis') is what I call 'Screen Rotations' in my demo.