[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?



Greg Ewing wrote:
Michael George wrote:

I'm not sure, but I think using that terminology, if you have a quaternion representing your position/orientation on the surface of the sphere, then converting it to euler angles gives your (longitude, latitude, heading) = their (heading, attitude, bank). Your motion routines should all be straightforward: convert each of your directions to quaternions, and then multiply.

There isn't much advantage to using quaternions rather than rotation
matrices if all you want to do is compose rotations. It's straightforward
to calculate rotation matrices for given angles around the x, y and z
axes and multiply them together. Although multiplying quaternions is
slightly easier than multiplying matrices, you have to convert the
result to a matrix in order to transform points with it, and the
extra computation required to do that loses most of the advantage.
However the OP's requirements were not that he needed to transform points, but that he needed to generate latitude, longitude and heading information to submit to another system. Quats seem a better fit for this IMO.

--Mike