   extracting object orientation out of quaternions.
  Ok, first let me say, I've been through the matrix & Quaternion FAQ and several Quaternion tutorials. I'm working on a 3D game engine using OpenGL and I've managed to get Quaternions working to rotate stuff, and while i can extract the proper orientation for the camera (i.e. i am able to move it around as i want to), when i try to use the same technique for my objects, it fails miserably. I have some idea of why this is, as the camera of course is just an object rotated "the opposite way"(don't really think that's it, but i dunno how to say it better) as a normal object would be, while an object is rotated just straightforward. duh. But i don't know of any solution to my problem :/.I'll try to show how i do the rotations, so that you can get an idea of what is happening. I realize that i might be doing stuff "the wrong way", so if you know how to do something better, please tell me ok. to start out, to me there exist 2 different types of rotations. relative and absolute. with absolute i mean, that the object is rotated in respect to the world axii, while relative means that the object is rotated in respect to it's own axii.I found that it is possible to do both relative and absolute rotations using quaternions, by just changin the order of multiplication. I use absolute rotations for the camera, which means i multiply in the following order: orientation = orientation * tempQuat2; this works just fine, and i can move around in my almost completely empty game world :Dhowever, when trying to do the same with objects, where i use relative rotation and thus the opposite order of multiplication, they float along some direction they definitely are not pointing towards. Well, I do use a different kind of rotation here, but in the end the object ends up with a combined rotation quaternion, how can this know what rotation i used ?I have thought about this problem for a couple of days now, and i just got more confused as time went by. I'd really appreciate it if someone could help me with this, because right now i am lost.thanksedit: i've found that the camera get's translated correctly because it is rotates the world opposite way from what you rotate the camera. but then there must be something wrong with the orientation extraction algorithm. i don't get it.[edited by - Quadratic on February 13, 2004 1:18:48 PM][edited by - Quadratic on February 14, 2004 2:49:10 AM]
  ok... so I''ve got it to work. if i use the proper order of multiplication, and reverse w in my axiangle rotation i get the proper (relative) rotation, AND translation works properly.if someone could explain this to me I''d be really happy ;  Question:  How are you building your quaternions, and how are you applying them?  A quaternion describes orientation by itself, so I''m not sure if you are rebuilding it every time you want to figure out the object''s orientation.  It sounds like you are building it, from the way you''re talking about the multiplication order.  Are your quaternion transforms on any given object being done around identity (absolute rotation, as you called it), or is it being done around respective transformed axii on the object itself.I hope I haven''t lost you, I may have lost myself. 