failing to use quaternions to point models
Posted: 13.07.2021, 16:39
I am on my 3rd attempt to point my 3D models using quaternions. Over the years I have failed and I still cannot use quaternions properly.
I created a simple triangle model and placed it in inertial space using the *.xyzv and *.q format.
It appears when my quaternion inertial to body (Qi2b) = 1 0 0 0 entry (no rotation) in the *.q file, the model point towards the vernal equinox (I think). I think that is where is should point because the X axis is defined to point to the vernal equinox. When I turn on the body and frame axis (by right clicking on my triangle) the X axis are 180 apart. I have not presented any rotations so shouldn't the x axes line up? Below is my simple *.scc file.
"SLS_Nom vFS" "Sol/Earth"
{
Class "spacecraft"
Mesh "basic_rot.cmod"
Radius 0.040
Visible true
Clickable true
Color [0.98 0.97 1.0]
# the BodyFixed is for orientation
OrbitFrame { EquatorJ2000 { Center "Sol/Earth" } }
SampledTrajectory
{
Source "nominal_vFS.xyzv"
DoublePrecision true
}
BodyFrame { EquatorJ2000 { Center "Sol/Earth" } }
SampledOrientation "nominal_vFS.q"
}
I turn on the Body and Frame Axis by right clicking on the vehicle and selecting "Reference Marks". Is the frame axis inertial. The z points up parallel to the earth's poles so I assume it is.
My *.q file gradually pitches the triangle up (positive) slowly over time but the model rotates around the Frame Axis' negative y axis. This is negative of what I expected. Then, I roll the vehicle slowly but the model rotates around the Frame Axis' negative x axis.
It appears there needs to be a rotation of 90 deg but the Orientation[] does not work in the *.scc anymore. Do I have to do this in my 3D model or go back and insert the 90 deg rotation in my quaternion? I swapped y and -z in my 3d model and the model now lines up with the red/green/blue body axis.
I have seen suggestions to use quat as w x -z y but surely Chris did not intend for us to do this. Chris posted:
2454025 0 0 1 0
2454026 0.707 0.707 0 0
2454027 0 0 1 0
2454028 1 0 0 0
2454029 0 0 1 0
2454030 0 1 0 0
2454031 0 0 0 1
2454032 1 0 0 0
on https://www.classe.cornell.edu/~seb/celestia/celestia_notes.html#5.9.2
and said that it represents 90 and 180 deg rotations but he never shows it in 3D. I am thinking that there is a bug.
I created a simple triangle model and placed it in inertial space using the *.xyzv and *.q format.
It appears when my quaternion inertial to body (Qi2b) = 1 0 0 0 entry (no rotation) in the *.q file, the model point towards the vernal equinox (I think). I think that is where is should point because the X axis is defined to point to the vernal equinox. When I turn on the body and frame axis (by right clicking on my triangle) the X axis are 180 apart. I have not presented any rotations so shouldn't the x axes line up? Below is my simple *.scc file.
"SLS_Nom vFS" "Sol/Earth"
{
Class "spacecraft"
Mesh "basic_rot.cmod"
Radius 0.040
Visible true
Clickable true
Color [0.98 0.97 1.0]
# the BodyFixed is for orientation
OrbitFrame { EquatorJ2000 { Center "Sol/Earth" } }
SampledTrajectory
{
Source "nominal_vFS.xyzv"
DoublePrecision true
}
BodyFrame { EquatorJ2000 { Center "Sol/Earth" } }
SampledOrientation "nominal_vFS.q"
}
I turn on the Body and Frame Axis by right clicking on the vehicle and selecting "Reference Marks". Is the frame axis inertial. The z points up parallel to the earth's poles so I assume it is.
My *.q file gradually pitches the triangle up (positive) slowly over time but the model rotates around the Frame Axis' negative y axis. This is negative of what I expected. Then, I roll the vehicle slowly but the model rotates around the Frame Axis' negative x axis.
It appears there needs to be a rotation of 90 deg but the Orientation[] does not work in the *.scc anymore. Do I have to do this in my 3D model or go back and insert the 90 deg rotation in my quaternion? I swapped y and -z in my 3d model and the model now lines up with the red/green/blue body axis.
I have seen suggestions to use quat as w x -z y but surely Chris did not intend for us to do this. Chris posted:
2454025 0 0 1 0
2454026 0.707 0.707 0 0
2454027 0 0 1 0
2454028 1 0 0 0
2454029 0 0 1 0
2454030 0 1 0 0
2454031 0 0 0 1
2454032 1 0 0 0
on https://www.classe.cornell.edu/~seb/celestia/celestia_notes.html#5.9.2
and said that it represents 90 and 180 deg rotations but he never shows it in 3D. I am thinking that there is a bug.