Re: [Plib-users] Problem with rotations
Brought to you by:
sjbaker
From: Ben W. <za...@ec...> - 2002-09-10 11:16:49
|
That is a good question, and I don't know the answer. But why would it work for header and role. h=1 p=0 r=0 this works fine and rotates around. same with h=0 p=0 r=1 it also works fine. Its just h=0 p=1 r=0 That causing the problem. And why would it jump to another axe and the come back. I did also try this with just a matrix, were I created the rotation matrix with sgMakeRot4, then muliply it by the location and running the transform without converting it back to euler, but I got the same result. The thing I find weird is that its only when it hits one axe that it jumps to anyother one. Anyway I don't know, I can't find the problem, and I have a test problem that does it, but I just don't understand why its doing it, so I can't really explain. Ben ----- Original Message ----- From: "Steve Baker" <sjb...@ai...> To: <pli...@li...> Sent: Tuesday, September 10, 2002 1:47 AM Subject: Re: [Plib-users] Problem with rotations > > > 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 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |