Keeping track of torations arround arbitary points

Started by
4 comments, last by Xerion 15 years, 2 months ago
The titile may be a bit enigmatic but i am in need to know the angles of rotations that are applied when a user moves arround. The user can rotate freely arround any axis or any arbitary point. Things are really easy if you allow rotation only arround x,y,z axis as you can just keep track of the 3 rotation angles... But what happens when we have rotations arround arbitary points ? How can i find the 3 angles that i need to rotate from my origin to get at the same exact view that the user had ? I only talk about rotations cause the translations are really easy to get from the GL_MODELVIEW[16]. I need to do that so i can save the exterior orientation(EO) of the locations that the user selects which actually means knowing the x,y,z and the 3 rotations ω,φ,κ from the origin of the coordinate system. Not allowing the user to move freely arround is not a solution :P Thank you in advance
Advertisement
Without knowing exactly what kind of interface you have in mind, I can't give you much in the way of specific advice. However, I kind of doubt that Euler angles are the optimal solution here. If you're dealing with arbitrary rotations, why not just store your orientations in matrix or quaternion form, and then apply incremental rotations as needed?

If that doesn't help, perhaps you could tell us a little more about the context.
Thank you for your answer. Let me provide some more info then and see where it goes :)
The interface is not something special i think. It is a 3d world representation in order to simulate a "virtual" test field for photogrammetric calibrations. So the user can move and rotate freely at the test field. I dont want to keep track of all his movements and rotations but at the specific points that the user chooses i want to know the location of that specific point as it is the exterior orientation of the camera. And to know that what i actually need is the 3 tranformations and 3 rotations from the origin of the coordinate system.

I dont really know what else to say. I hope i provided some more info but if you have any specific question i am more than happy to answer. At the moment i am using an actor frame to manage the moving arround the "world".

PS. I dont have to use Euler angles but i need to know the Euler angles as an output lets say (its a simulation so what i test onwards is how accurate i find the orientation and location so i got to have something to compare it with :) ) and also cause i want to draw something at that location which can only be done with glPushMatrix() transform and rotate with that position and orientation in space for every "selected location". I am open to suggestions though :) sure there is a better way to do it.

What is more accuarate quaternions or Euler? i know i can extract the euler angles from the rotation matrix but there can be different combinations that satisfy that rotation. Since i have never worked with quaternions i am asking for you experience over the matter!

Thank you again !

[Edited by - Xerion on February 9, 2009 11:52:42 PM]
If you extract the angles from the rotation matrix there are ambiguities which can lead to object facing the wrong way if you draw something with that extracted angles.

Is that ambiguity resolved if you use quaternions ? Cause from what i see there is not much of a difference cause in both ways you need to get the atan which actually will give two solution for each angle.

Any help ?

atan2
[TheUnbeliever]
Well, it seems that i need your help again about this matter. Everything works smooth as , up to a point but then it breaks. I use the angles that i extract from the rotation matrix along with the translations to move to that location and then glRotate so i can finally draw some things... and everything is good up to a point when i can see that the object i am drawing faces on a weird angles and not towards where it is supposed to be...

I checked my code and is similar to what i have found over the internet and people say that it is indeed working but when i do arbitary rotations to the 3d space it seems that things brake at a point and if i keep moving arround they get fixed. I tried to understand when things break and why but i could not find anything..

I am open for different suggestions if you have any on how to draw on the place where the camera is :)
I can post my code if you think that it helps but i am just using something similar to http://www.gamedev.net/community/forums/topic.asp?topic_id=319213 ths one to extract the angles.

Thank you one more time, your help is priceless :D

This topic is closed to new replies.

Advertisement