Sign in to follow this  

Calculating Orientation

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, This isn't strictly to do with developing games, but I have a question about orientations that I hope someone can help me with. A space-based game that I'm attempting to modify uses a set of four values to calculate the orientation of an object in three dimensions; I've done a lot of searching on the net and it seems to me that it could be using an "angle-axis" representation. Could someone point me to a site or show me how to convert from this method of orienation to, say, an (x,y,z) rotation that I can work with. I've worked out some intermediate values but I can't see any pattern linking them... e.g. (1,0,0,0) - Pointing straight ahead. (1,0,-1,0) - Rotated -90 degrees about the y-axis (1,0,1,0) - Rotated 90 degrees about the y-axis (0,0,1,0) - Facing backrwards, i.e. rotated 180 degrees about the y-axis. Thanks in advance.

Share this post


Link to post
Share on other sites
At first glance those values look like the non-normalized quaternion representations of those rotations. Perhaps you can find something in the project you're working on to confirm that.

If that is the case, then I take it you want to convert these representations to Euler angles? That can certainly be done, but what do you need the Euler angles for? Especially in a (presumably 6dof) space game, Euler angles are not the most effective representation for an orientation.

In any case, a google for 'quaternion euler angle conversion' might turn something up. Remember your quaternions (if that's what they are) aren't normalized. Or, if you already have code to extract Euler angles from a matrix, you could convert the quaternions to matrices first. Most quat-to-matrix examples assume unit-length quaternions, but you can actually convert a non-unit-length quaternion to a matrix without normalizing (i.e. no square root).

Anyway, I may be way off-base about that. But let me know if you need any further clarification.

Share this post


Link to post
Share on other sites

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this