Re: [GD-General] quaternion conversion
Brought to you by:
vexxed72
From: Colin F. <cp...@ea...> - 2003-07-02 18:07:03
|
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 |