I wrote this ScriptOrbit for two reasons. First of all, it's another example of how to write a ScriptedOrbit. Second, it's useful for simple animations of things like spacecraft components. Unlike SampledTrajectory, no extra file is required it. The ability to repeat the animation is also useful. This ScriptedOrbit is not meant to use large numbers of position keys, as the algorithm it uses to find a pair of keys to interpolate is a simple linear search that will be slow when there are many keys.
--Chris
Code: Select all
"Scripted" "Sol/Eros"
{
Class "spacecraft"
Radius 1
ScriptedOrbit
{
Module "animationlib"
Function "animationpath"
TimeBase 2454854.77083
Loop true
Pos1 "0 -30 0 0"
Pos2 "2 11 20.1 30"
Pos3 "5 11 -20 -20"
Pos4 "10 -30 0 0"
}
}