Bernard Leclerc (bleclerc++at++cae.ca)
Tue, 3 Sep 1996 10:15:37 -0400
> 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!)
Your right. There's no way to "reconstruct r" from a unit vector. As you
mentionned, this vector gives you the direction to look for... and any
roll angle will still have you look in the same direction.
BTW, the pitch angle is obtained by
d = sqrt(x^2 + y^2)
p = atan2(z,d)
That should be enough.
--
Bernard Leclerc CAE Electronics Ltd., 8585 Cote De Liesse
Technical Leader Saint-Laurent, Quebec, Canada, H4L-4X4
3-D Graphics Applications tel: +1 514 341 2000 extension 2275
bleclerc++at++cae.ca fax: +1 514 340 5496
=======================================================================
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