Michael T. Jones (mtj++at++babar.asd.sgi.com)
Tue, 3 Sep 1996 09:52:56 -0700
actually, you seem to get it...
> What is a good reliable way to transform a unit vector (x,y,z) representing
> a direction back into (h,p,r) form? I can sort of do this by doing
>
> h = pfArcTan2(x,y);
> p = pfArcTan2(z,y);
> r = ???;
>
> but this only seems to give the correct results in some cases. (And
> I don't believe there is a way to reconstruct r!)
You can't "reconstruct" the roll since the unit vector does not give
it. I you want to make a default rule about the roll, then you'll be
fine. If you wanted a specific roll value, you'd need an additional
number representing the roll about the specified axis -- this is the
missing ingredient that allows quaternions to get the job done.
You can also use the pfQuat functions to convert for you by selecting
some default roll (such as zero).
Michael
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:30 PDT