Arbitrary 3D rotation expressed in principle axis rotations

Munch

Benevolent Despot
Joined
May 25, 2006
Messages
2,081
I hope this is the right place for this ...

I understand that any rotation in three-dimensional space can be expressed using, say, z-x-z Euler angles (http://en.wikipedia.org/wiki/Euler_angles). However, the particular application for which I need to invoke three-dimensional rotation requires that all rotations are performed about the principle axes (that is, the x y and z axes in their original, standard locations).

Firstly, I think that non-principle axis rotations can be expressed as a combination of principle axis rotations. This is a fine solution to the problem, but how are these principle axis rotations derived?

Secondly, a z-x-z Euler angle rotation would be decomposed into several successive principle axis rotations. Is it possible instead to unambiguously define an arbitrary rotation using say, a z-x-z combination of principle axis rotations? This three rotation solution would be simpler than decomposing Euler angle rotations, surely ...

Any help here would be greatly appreciated. :)
 
What is the application?

Quaternions are usually better than Euler angles for rotations. Or just leave in matrix form.
 
What exactly is your problem? If you rotate the vector (and not the coordinate system), your rotation is simply the product of the axis rotations.
 
Munch, what is your available data? I understand from your post that you want to be able to express it in r(x), r(y), r(z) for a Cartesian coordinate system that is not related to the position of your object - correct?


I have similar problems in my work, so if you give me details on what you have, I might be able to help.
 
The application is the rotation of 3d arrays. Because I am bound to working within the discrete 3d array structure (a rectilinear grid in 3d space where points can only be declared at integer coordinates) I cannot just perform rotation as you would in continuous space. That is, in continuous space in either 2d or 3d you could just move each floating point coordinate to its destination floating point coordinate. But within an array structure this isn't possible, as you can't send [1][1] to [0][sqrt2].

Thus there are two ways to perform rotation within an array structure and still obtain only integer coordinates afterwards. You can smooth the data (kind of anti-aliasing) by defining the integer coords post-rotation to be proportional to the nearest few data points in floating point positions; trouble with smoothing is that it doesn't preserve the value of your data points and is noninvertible as you end up with more data points than before rotating. The second way is to somehow 'snap' your points to nearby integer locations. If you just round your floating point coordinates after rotation then you still get problems, as sometimes more than one point can round to the same destination, or you'll get integer points to which no floating point is closest. So, the way I've been doing rotation so far is by using the three shears technique, which for a 2d plane within your 3d array, performs shearing actions alternately on the vertical then horizontal then vertical 'rows', each time making sure that only integer coords are output. The product of three shears as defined by the transform maintains the shape of your original data but is on the slant, so if you began with a square you end up with a square with jagged edges.

I've implemented this for principle axis rotation, and I think it works fine. Now I want to be able to perform any kind of rotation, but that would involve either adapting my three shears algorithm to handle non-principle axis rotations, or decomposing any rotation into a product of principle ones.

Does that make sense?
 
ugh! that's nasty, being fixed to integer... you are using a computer program for this? what is it? Can't you transfer to a proper CAD software that can rotate your point clouds whole?
 
Firstly, I think that non-principle axis rotations can be expressed as a combination of principle axis rotations.

I'm probably understanding something wrong, but if you rotate around x-,y- or z-axis, (0,0,0) can not move, and if you rotate around line which doesn't go through origo it can move.

EDIT: It's probably the word "axis": is it defined to include the origo?
 
ugh! that's nasty, being fixed to integer... you are using a computer program for this? what is it? Can't you transfer to a proper CAD software that can rotate your point clouds whole?

Yes it's incredibly nasty.

I am modelling the change in a particular property around an object. The software I use to generate the original data places the object inside a rectilinear grid and measures the property at each vertex. Obviously the values obtained are dependant on the orientation of the object before running the software. In this particular problem I have two grids, generated for teh same object in two different orientations, and I want to rotate one to lay over the other and I want to find that the, say, Euclidean distance between the grids is at a global minimum when they are overlaid like you would expect.

This is why I currently think I have to stick to integer coords. If one grid expresses say 100 vertices all at integer coords, and the second is rotated to overlay with it but the points are at floating point positions, is it possible to measure the difference between these two representations seeing as the points in one do not correlate with the points in the other?

Assuming it isn't, I have resorted to the three shears rotation scheme for staying within integer coordinates. If anyone needs to know about three shears for whatever reason I can link you to a good paper.

Apart from the licensed software which calculates the measured properties, everything else is coded up by me.
 
I'm probably understanding something wrong, but if you rotate around x-,y- or z-axis, (0,0,0) can not move, and if you rotate around line which doesn't go through origo it can move.

EDIT: It's probably the word "axis": is it defined to include the origo?

For my application I am only interested in rotating around axes that pass through the origin, yes. Sorry for being ambiguous.
 
sorry, I can't help saying: get Rhinoceros or some other CAD software that can rotate and measure objects and distances freely. It is really a bother to write that stuff yourself.

I can't see an easy solution, as I have never done anything like that.
 
Top Bottom