Rotations about an arbitrary axis

Rose Oguz rose at BABY.SWMED.UTEXAS.EDU
Sat Jun 2 00:44:13 AEST 1990


In article <1990May31.171937.14296 at watcgl.waterloo.edu>,
jdchrist at watcgl.uwaterloo.ca (Dan Christensen) writes:

>In article <SPENCER.90May22144823 at spline.eecs.umich.edu> spencer at eecs.umich.edu (Spencer W. Thomas) writes:
>>In article <9005171647.AA14106 at baby.swmed.utexas.edu> rose at BABY.SWMED.UTEXAS.EDU (Rose Oguz) writes:
>>[Problem of rotation about an arbitrary axis.]
>>> Basically, I have two vectors coming
>>> from the same point and one of the vectors needs to be rotated into the 
>>> other.
>>
>>	You want to rotate the vector V1 into the vector V2.  We can
>>do this in two steps: (1) rotate V1 to the X axis and then (2) rotate
>>the X axis to V2.  (Why do this, you say?  Because each step is easy.)
>
>But there is more than one rotation mapping a vector V1 to a vector V2.
>The final result can be oriented in any way about V2.  The original
>poster indicated that he wanted the one that rotates about V1xV2,
>ie. the most "direct" rotation.  I don't think that your solution 
>does this. 

What I (the poster of the original question) wanted to was exactly map
vector V1 onto V2.  In other words, all points on one vector would be
the exact points on the other vector with the heads of the vectors
matched and the tails of the vectors matched.  

The algorithm suggested by Spencer Thomas works.  I know because I
implemented a modified version because my application wasn't simply
mapping one vector to another.  The method I used also comes from
Foley and Van Dam's Fundamentals of Interactive Computer Graphics.

Basically, there are only 2 rotations that can map one vector into
another, clockwise and counterclockwise, if you will.  I'm not sure
that you want me to go into detail about the above mentioned
algorithm; so, I won't now.  However, I will if anyone indicates so,
but I think article <SPENCER.90May22144823 at spline.eecs.umich.edu>, by
spencer at eecs.umich.edu (Spencer W. Thomas) explains the algorithm
quite clearly.

>For example, suppose in a right handed coordinate system the poster
>wants to rotate the y axis to the z axis (by rotating about y cross z,
>ie. the x axis).  This will map y -> z, z -> -y and x -> x.  I believe
>that your solution will map y -> z, z -> -x and x -> -y which is
>probably not what is wanted.  (I may have the details wrong, but I
>think the idea is right.)
>
>Here is some C code that will do what the poster wants.  
> ...
>/* Obtained from a paper by Michael Pique */
I have glanced at the code, but I have not spent much time with it.
I'm not sure of what you've indicated.  However, if you could direct
me to the paper by Michael Pique, I will try to spend some time with
it.

					
					Rose



More information about the Comp.sys.sgi mailing list