# Rotation Matricies

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

## Recommended Posts

Hi I have a 3D object. I would like to perform a 3D rotation about its COM (centre of mass), in terms of theta and phi. Not about the axes. I did have a piece of code to do this, but have lost the official reference for where I saw this worked out in more detail. I know it was a coupled combination of a rotation by theta and then phi for example. Can anyone point me to a good source of information on this. Thanks Dis

##### Share on other sites
theta and phi are just greek symbols; they could represent whatever you want depending on the context, but they are commonly used in textbooks to represent the angles in polar coords.

I'm guessing that you want to look into Polar Coordinates? or something along those lines?

EDIT:
Ignore 'polar coords' I was probably thinking of 'Spherical Coordinates' as haegarr mentions below. (when you don't use either of them much, its easy to forget the right terms)

[Edited by - haphazardlynamed on January 17, 2008 11:11:52 PM]

##### Share on other sites
In this case of 2 angles in 3D world I would assume the OP is speaking of the 2 angles of spherical co-ordinates (with the radius implicitely defined to be 1). Google knows plenty of pages about "spherical coordinates" (~375k hits). They are much more informative and illustrated than I can do here. But be observant that the formulas differs in details (not in structure) dependend on e.g. what axis is the "zero angle axis".

I don't know whether direct conversion to matrices exists. Using spherical co-ordinates just to compute cartesian co-ordinates yields in the target vector only. In that case the usual cross- and dot-product way of computing the axis/angle rotation representation, and the also usual matrix conversion routine can be used.

EDIT: To rotate about the COM, the rotation matrix has to be surrounded by translations. Assuming that the object's mesh is given in its own local co-ordinate frame, the object 1st has to be translated so that the COM rests at (0,0,0). After the rotation those translation has to be undone. I.e. if using column vectors, and T denotes the local COM, and R the rotation, then
T * R * T-1
is the entire thing (reverse the order for using row vectors).

[Edited by - haegarr on January 17, 2008 2:34:03 AM]

##### Share on other sites
The problem relates to the fact that I have implemented code to perform rigid body rotations about the COM of the object. However most textbooks (that I can find) only simply use rotations about the axes - whereas this implementation is more generic in that we perform rotations about the C.O.M. I cannot remember since I have lost the original reference and was hoping that I would find something that would jog my memory of how to do it again from first principles.

Hope this helps or I could be pointed in the right direction.

Thannks

##### Share on other sites
Moving to Math & Physics.

##### Share on other sites
Quote:
 Original post by disruptiveThe problem relates to the fact that I have implemented code to perform rigid body rotations about the COM of the object. However most textbooks (that I can find) only simply use rotations about the axes - whereas this implementation is more generic in that we perform rotations about the C.O.M. I cannot remember since I have lost the original reference and was hoping that I would find something that would jog my memory of how to do it again from first principles.Hope this helps or I could be pointed in the right direction.Thannks

First of all, your thinking here is a little muddled. You speak about rotating around the COM (a point) rather around "the axes". A rotation is always around a particular point--the center of rotation, which falls out as an eigenvector--as well as relative to a particular set of axes (the basis for the axis of rotation). What it sounds like you're running into is that the order of your rotations is relative to the world axes (aka the world coordinate system), rather than to the object-local coordinate system. To get local as opposed to global rotations, just do them in the opposite order. That is, a local series of X Z Y rotations is equivalent to a global series of Y Z X rotations.

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 11
• ### Forum Statistics

• Total Topics
633653
• Total Posts
3013157
×