Re: [GD-General] quaternion conversion
Brought to you by:
vexxed72
From: Chris H. <c.h...@ke...> - 2003-07-03 04:58:09
|
Hi Colin, Yes, I think so. And that explains the strange results. The flipping was more or less done out of 'I did not know what to do' :) The problem is that our rendering system and scenegraph is left-handed while a sensor connected to my PC is outputting quaternions in right-handed space..... I'll try the hack with the matrices. Thanks, Chris ----- Original Message ----- From: "Colin Fahey" <cp...@ea...> To: <gam...@li...> Sent: Wednesday, July 02, 2003 8:00 PM Subject: Re: [GD-General] quaternion conversion > > By "flipping the sign of the x-coordinate" do you mean you > are doing the following: > > q = ( x, y, z, w ) > > --> ( n; theta ) = ( nx, ny, nz; theta ) > > --> ( n'; theta ) = ( -nx, ny, nz; theta ) ? > > Flipping the x-component normal vector (the "axis" part of > axis-angle) is not the same as flipping the x-coordinate of > points transformed by that quarternion. > > One temporary hack experiment is to convert the quaternion > to a matrix, invert the sign of elements in the row that > yields the x-coordinate ( i.e., x = r31 * x + r32 * y + r33 * z > ==> Invert to: (-r31), (-r32), (-r33) ). > > Basically, I think you have to postpone switching to a > left-handed coordinate system until you are finished doing > your calculations. You cannot, for example, benefit from > taking the modified matrix described in the previous > paragraph and converting it back to a right-handed > quaternion; it's meaning would be perverse and useless. > > > OFF-TOPIC: > > D3D had more than five years to switch to a right-handed > coordinate system. Isn't there an incentive to do so, to > coincide with conventional right-handed cross-products, > quaternions, and all the mathematical results based on > such things? Doesn't anyone complain? If as many > textbooks on D3D point out "It is easy to switch to a > right-handed coordinate system by changing the transformation > matrix", why not simply change the default to a right-handed > system? > > > --- Colin > > > ----- Original Message ----- > From: "Chris Haarmeijer" <c.h...@ke...> > To: "gdgeneral" <gam...@li...> > Sent: Wednesday, July 02, 2003 2:16 AM > Subject: [GD-General] quaternion conversion > > > Hi, > > I've got an incoming quaternion from a sensor. This sensor has a coordinate system that is right-handed. Our rendering system is > based on a left-handed system. I've tried converting the quaternion to Axis-Angle and then flipping the sign of the > x-coordinate, but that produces strange results. > > Anyone knows an answer or hint to this problem? > > Chris > > --- > Keep IT Simple Software > Van Alphenstraat 12 > 7514 DD Enschede > > W: http://www.keepitsimple.nl > E: mailto:in...@ke... > T: +31 53 4356687 > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 |