Re: [Plib-users] Problem with rotations results
Brought to you by:
sjbaker
From: Ben W. <za...@ec...> - 2002-09-11 10:12:49
|
----- Original Message ----- From: "Steve Baker" <sjb...@ai...> To: <pli...@li...> Sent: Tuesday, September 10, 2002 11:46 PM Subject: Re: [Plib-users] Problem with rotations results > Ben Woodhead wrote: > > > Wow, I had no idea the results returning from a matrix were that like that.. I > > understood what you meant, when you said h <> h, and so on. But I didn't > > realise just how off they would actually be. > > Yes - well, it's a mathematical fact. There are an infinite number of ways > to represent an arbitary rotation matrix in terms of Euler angles - and the > code has no way to know which one you wanted - so it just picks one. > > It's hard to know what else we could do. > > > Anyway back to the point, I was > > wrong about the 0 and 180, its at 90 degrees that cause the problem. Here is > > the header, pitch and role from the 3 different rotations. Take a close look > > at the pitch. > > (BTW: The word is "Roll" - not "Role" and "Heading" - not "Header") > > > Pitch > > Header: -0.000000, Pitch: 88.002075, Role: -0.000000 > > Header: -0.000000, Pitch: 89.004166, Role: -0.000000 > > Header: 0.000000, Pitch: 90.000000, Role: 90.000000 > > Eh? Are you sure the heading was zero? I'd expect it to > be -90 or something. No, that was actually the log from the program running, that I copied into here.. That was what was causing me the greef. > But anyway - this *is* classic 'Gymbal Lock'. Ah, I always thought gymbal lock was only when rotating around all 3 axes at the same time. > As Norman suggested, you can visualise it in these > terms: > > "A hunter walks South one mile from his tent, then > he is chased due East for one mile by a ferocious Bear. > Having escaped, he walks North for one mile and finds > himself back at his tent. What colour was the Bear?" > > (White!) What? I don't get it.. > > As you can see in pitch when it hits 90 on pitch, role also goes to 90. The > > one thing that I just noticed is that non of the other rotations get to > > exactly 90.0. > > It's not so much that Roll or Pitch is special, it actually comes > about that way because of the order of rotational operations. > > The bottom line is that Mat-to-Coord is working OK - it's just > that you have to understand it's limitations. Well, thanks everybody.. I rewrote all the code to have not use coord and everything is good.. Thanks Ben > ----------------------------- 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 > > > > > > ------------------------------------------------------- > In remembrance > www.osdn.com/911/ > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |