These two curves could be useful for Celestia Sci-fi users. They simulate a motion saw often in the Sci-fi movies: the dock bay approach. Usually a spacecraft escape from iperspace at high velocity for then accomplish a slowly approach to the bay. Or, it lift off the bay with slow velocity for then jump into iperspace.
Paste this code in the scriptorbit.ssc:
Code: Select all
"Scifi_docks X" "Sol/Eros"
{
Class "spacecraft"
Radius 1
Color [ 1 0 1 ]
OrbitFrame { BodyFixed { Center "Sol/Eros" } }
BodyFrame { BodyFixed { Center "Sol/Eros" } }
ScriptedOrbit
{
Module "scifi_docks"
Function "scifi_docks"
PeriodX 0.000025
PeriodY 0.000025
PeriodZ 0.000025
PhaseX 0.25
PhaseY 0.25
PhaseZ 0.0
AmplitudeX 25
AmplitudeY 25
AmplitudeZ 0.0
}
}
Then paste the text below in a editor and save it as scifi_docks.lua module in the ../celxx/ dir:
Code: Select all
function scifi_docks(t)
-- Create a new table
local orbit = {};
-- Save the parameter list
orbit.params = t;
-- Set the required fields boundingRadius and position; note that position is actually a function
-- Compute the bounding radius from the amplitudes
orbit.boundingRadius =
math.sqrt(t.AmplitudeX * t.AmplitudeX +
t.AmplitudeY * t.AmplitudeY +
t.AmplitudeZ * t.AmplitudeZ)
-- The position function will be called whenever Celestia needs the position of the object
function orbit:position(tjd)
local t = tjd - 2451545.0
local pi2 = math.pi * 2;
-- Bay approach --
local x = self.params.AmplitudeX * math.exp (1 / math.tan((t / self.params.PeriodX - self.params.PhaseX)))
local y = self.params.AmplitudeY * math.exp (1 / math.tan((t / self.params.PeriodY - self.params.PhaseY)))
local z = self.params.AmplitudeZ * math.exp (1 / math.tan((t / self.params.PeriodZ - self.params.PhaseZ)))
-- Bay escape -- comment the formers and uncomment the follows --
-- local x = self.params.AmplitudeX * math.exp (math.tan((t / self.params.PeriodX + self.params.PhaseX)))
-- local y = self.params.AmplitudeY * math.exp (math.tan((t / self.params.PeriodY + self.params.PhaseY)))
-- local z = self.params.AmplitudeZ * math.exp (math.tan((t / self.params.PeriodZ + self.params.PhaseZ)))
return x, y, z
end
return orbit
end
Goto Eros. Being on the XY plane, for the moment try to incline a bit the cameraview to see the "depth" of the effect.
Never at rest.
Massimo