Page 1 of 1

New ScriptedOrbit: Animation path

Posted: 23.01.2009, 05:54
by chris
Attached is a sample add-on that uses a new ScriptedOrbit I've created for simple animation. It allows you to specify any number of position keys in the ssc file. Each key is a string with four numeric values: a time in seconds, and x, y, and z coordinates in kilometers. The Loop parameter a boolean value that determines whether the animation runs just once or repeats for ever. The TimeBase parameter is the Julian date at which the animation begins.

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"
    }
}

Re: New ScriptedOrbit: Animation path

Posted: 23.01.2009, 17:11
by selden
Chris,

animationpath.zp does not contain the module animationlib.lua
Instead it contains the directory scriptorbit and celxx/pathtrajectory.lua

Did you accidentally Zip the wrong directory?

Re: New ScriptedOrbit: Animation path

Posted: 23.01.2009, 20:04
by chris
selden wrote:Chris,

animationpath.zp does not contain the module animationlib.lua
Instead it contains the directory scriptorbit and celxx/pathtrajectory.lua

Did you accidentally Zip the wrong directory?

Thanks, Selden--I've now uploaded the correct zip file. Let me know if it's useful to you.

--Chris