Rotations
Posted: 19.10.2006, 08:08
A new feature in Celestia 1.5.0 is a much more flexible scheme for describing an object's orientation, together with a cleaner syntax for rotations in ssc files. There are now different types of rotation, much like there are different types of orbits right now (CustomOrbit, SampledOrbit, EllipticalOrbit, etc.)
In Celestia 1.4.1 and earlier, the rotation parameters appeared at the top level of an ssc body definition. For example, here's part of the definition of Earth:
In Celestia 1.5.0, this same syntax is still supported for backward compatilibity. But, you can also specify a rotation type with a grouped set of parameters. So this would be the preferred way to set the rotation parameters of Earth in 1.5.0:
Grouping the rotation parameters in the UniformRotation block keeps the object definition more organized, but more importantly the new syntax allows other types of rotations to be used. In addition to UniformRotation, there's PrecessingRotation, CustomRotation, and SampledRotation.
SampledRotation specifies a file of quaternion keys that are interpolated to compute the orientation of a body. I've heard a lot of requests for this feature, mostly from people interested in modeling spacecraft attitude more accurately than what Celestia 1.4.1 rotation parameters permitted.
A sampled orientation file is an ASCII text file with records of the form:
<time> <qw> <qx> <qy> <qz>
(qw qx qy qz) is a unit quaternion representing a rotation of theta =acos(qw)*2 radians about the axis (qx, qy, qz)*sin(theta/2). The time values are Julian days in Barycentric Dynamical Time. Here's a very simple example file:
This describes a series of 90 and 180 degree rotations over the time period from Oct 15-23, 2006. I created this file by hand for testing, but generally, orientation files will be created by some data conversion tool.
I took some time to make sure that Celestia uses the quaternions in an orientation file in a way that is consistent with the coordinate system in xyz files.
--Chris
In Celestia 1.4.1 and earlier, the rotation parameters appeared at the top level of an ssc body definition. For example, here's part of the definition of Earth:
Code: Select all
"Earth" "Sol"
{
Texture "earth.*"
Radius 6378.140
CustomOrbit "vsop87-earth"
RotationPeriod 23.9344694
Obliquity -23.4392911
RotationOffset 280.5
}
In Celestia 1.5.0, this same syntax is still supported for backward compatilibity. But, you can also specify a rotation type with a grouped set of parameters. So this would be the preferred way to set the rotation parameters of Earth in 1.5.0:
Code: Select all
"Earth" "Sol"
{
Texture "earth.*"
Radius 6378.140
CustomOrbit "vsop87-earth"
UniformRotation
{
Period 23.9344694
Inclination -23.4392911
Offset 280.5
}
}
Grouping the rotation parameters in the UniformRotation block keeps the object definition more organized, but more importantly the new syntax allows other types of rotations to be used. In addition to UniformRotation, there's PrecessingRotation, CustomRotation, and SampledRotation.
SampledRotation specifies a file of quaternion keys that are interpolated to compute the orientation of a body. I've heard a lot of requests for this feature, mostly from people interested in modeling spacecraft attitude more accurately than what Celestia 1.4.1 rotation parameters permitted.
A sampled orientation file is an ASCII text file with records of the form:
<time> <qw> <qx> <qy> <qz>
(qw qx qy qz) is a unit quaternion representing a rotation of theta =acos(qw)*2 radians about the axis (qx, qy, qz)*sin(theta/2). The time values are Julian days in Barycentric Dynamical Time. Here's a very simple example file:
Code: Select all
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
This describes a series of 90 and 180 degree rotations over the time period from Oct 15-23, 2006. I created this file by hand for testing, but generally, orientation files will be created by some data conversion tool.
I took some time to make sure that Celestia uses the quaternions in an orientation file in a way that is consistent with the coordinate system in xyz files.
--Chris