Re: [Plib-users] Problem with rotations
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2002-09-10 04:48:43
|
Ben Woodhead wrote:
> Ya, I don't have a problem with that.. It seems to be sgMakeRotMat(mat,
> h,p,r) where pitch is set to something other then 0. Then I converted it
> back to sgCoord and used transform...
Could your confusion be this:
* You take three angles (H,P,R) and convert them into a matrix M
(using sgMakeRotMat...or whatever).
* Then you convert M *BACK* into an sgCoord and extract (H',P',R').
Do you expect (or rely upon) H' == H, P' == P and R' == R ???
If so, then that's not right. There are an infinite number of values
for H,P,R that all generate the exact same rotation matrix. Hence, when
you convert a matrix *BACK* into three Euler angles, you don't get the
same three angles back...although the three angles you get *DO* perform
the same effective rotation as the three you put in.
Hence, it's possible to say things like:
H = 0
P = 180
R = 0
...then convert to a matrix...convert back again and get back:
H' = 180
P' = 0
R' = 180
...totally different numbers - but having the same exact same effect.
If that is your problem, then it's not something that we can fix - it's
just the way math works.
----------------------------- Steve Baker -------------------------------
Mail : <sjb...@ai...> WorkMail: <sj...@li...>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net
|