Re: [Plib-users] Problem with rotations results
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2002-09-11 02:54:30
|
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. But anyway - this *is* classic 'Gymbal Lock'. 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!) > 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. ----------------------------- 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 |