# Calculating Orientation

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

## 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 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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633289
• Total Posts
3011225
• ### Who's Online (See full list)

There are no registered users currently online

×