Spherical to Euler Conversions
Posted: Mon Jul 16, 2007 3:15 pm
Hi all,
I’m trying to use Irrlicht to view the results of simulation runs.
The simulation outputs a file containing time, position in North/East/Down, and attitude in Azimuth, Elevation, and Roll. I built a driver that reads in the file and interpolates to find the current position and attitude, then applies those values to a scene node with a 3d model attached. There are no problems with the position of the model, but the rotation is another story.
Right now, the attitudes are being derived from the inertial velocity vectors as follows:
Azimuth = atan2(vely,velx) // 0 degrees is north, increasing CW is positive
Elevation = asin(velz/velmag) // 0 degrees is horizontal, increasing down is positive
Roll = 0.0 // to be calculated later
What I need to do is find the Euler angles which, when added up in Irrlicht, will result in the same inertial orientation that is in the file
To find the Euler angles, I can take a set of reference axes, and rotate the set around one axis at a time until the orientation matches the desired attitude, but what order would I need to do that in?
Any advice or tips would be appreciated. I’ve already done some searching here, but the combination of the rotation order questions and the reference system differences between the simulation and Irrlicht has got me stymied.
--Carl
I’m trying to use Irrlicht to view the results of simulation runs.
The simulation outputs a file containing time, position in North/East/Down, and attitude in Azimuth, Elevation, and Roll. I built a driver that reads in the file and interpolates to find the current position and attitude, then applies those values to a scene node with a 3d model attached. There are no problems with the position of the model, but the rotation is another story.
Right now, the attitudes are being derived from the inertial velocity vectors as follows:
Azimuth = atan2(vely,velx) // 0 degrees is north, increasing CW is positive
Elevation = asin(velz/velmag) // 0 degrees is horizontal, increasing down is positive
Roll = 0.0 // to be calculated later
What I need to do is find the Euler angles which, when added up in Irrlicht, will result in the same inertial orientation that is in the file
To find the Euler angles, I can take a set of reference axes, and rotate the set around one axis at a time until the orientation matches the desired attitude, but what order would I need to do that in?
Any advice or tips would be appreciated. I’ve already done some searching here, but the combination of the rotation order questions and the reference system differences between the simulation and Irrlicht has got me stymied.
--Carl