ScriptedOrbit tutorial
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
ScriptedOrbit tutorial
##########################################################################
As start is required to read here:
http://en.wikibooks.org/wiki/Celestia/Trajectories#SampledOrbit
then this thread.
##########################################################################
On plane XY white ball accomplish lemniscate motion, cyan the circle and yellow parabola
http://marauder.webng.com/files/lissajous_curve.zip
As start is required to read here:
http://en.wikibooks.org/wiki/Celestia/Trajectories#SampledOrbit
then this thread.
##########################################################################
On plane XY white ball accomplish lemniscate motion, cyan the circle and yellow parabola
http://marauder.webng.com/files/lissajous_curve.zip
Last edited by Fenerit on 11.10.2009, 19:35, edited 2 times in total.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
Hey Fenerit ! This method is extremely interesting ! It gives me a LOT of new ideas !
With the objects set to invisible by default and a toggle CELX switch, we could show lots of new things from within Celestia, using this scripted orbit method. I'll have to do some experiments ...
I guess I'll hit the limitations again ...
With the objects set to invisible by default and a toggle CELX switch, we could show lots of new things from within Celestia, using this scripted orbit method. I'll have to do some experiments ...
I guess I'll hit the limitations again ...
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Happy MAc no longer have problem. At post in which its malfunction is suggested as Mac bug doesn't happen nothing...
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
Fenerit wrote:Happy MAc no longer have problem. At post in which its malfunction is suggested as Mac bug doesn't happen nothing...
Sorry, I really don't understand what you said here. Could you elaborate ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Well, my Enceladus geysers were founds not working by MAC users, so was post by Ricardo in Celestia Bugs as advertisement. Now, perhaps, I, didn't understood: does the ScriptedOrbit is now working on MAC?
EDIT LATER:
My mistake: ScriptedOrbit not work and ScriptedRotation yes?
EDIT EDIT LATER:
Sorry, today I'm bit outofcontrol
EDIT LATER:
My mistake: ScriptedOrbit not work and ScriptedRotation yes?
EDIT EDIT LATER:
Sorry, today I'm bit outofcontrol
Last edited by Fenerit on 10.10.2009, 14:06, edited 1 time in total.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
Fenerit wrote:does the ScriptedOrbit is now working on MAC?
Well, as far as I can tell, the lissajou addon above is working on my Mac (while your volcanoes addon isn't).
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Cham wrote:Fenerit wrote:does the ScriptedOrbit is now working on MAC?
Well, as far as I can tell, the lissajou addon above is working on my Mac (while your volcanoes addon isn't).
AHHHHH... Is this my out of control!!! WHY? are both ScriptedOrbit!
Never at rest.
Massimo
Massimo
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
The main differences amongst statement blocks based upon different modules are below:
enceladus_geysers:
ScriptedOrbit
{
Module "animationlib_eg"
Function "animationpath_eg"
TimeBase 2454854.77083
Loop true
Pos1 "0 0 0 0"
Pos2 "0 0 0 25"
Pos3 "25 -0.11 -0.12 -0.13"
Pos4 "51 0 0 0"
}
lissajous_curves:
ScriptedOrbit
{
Module "lissajous_1"
Function "lissajous_1"
PeriodX 0.00025
PeriodY 0.0005
PeriodZ 0.00025
PhaseX 0.25
PhaseY 0.5
PhaseZ 0.0
AmplitudeX 25
AmplitudeY 35
AmplitudeZ 0.0
}
enceladus_geysers:
ScriptedOrbit
{
Module "animationlib_eg"
Function "animationpath_eg"
TimeBase 2454854.77083
Loop true
Pos1 "0 0 0 0"
Pos2 "0 0 0 25"
Pos3 "25 -0.11 -0.12 -0.13"
Pos4 "51 0 0 0"
}
lissajous_curves:
ScriptedOrbit
{
Module "lissajous_1"
Function "lissajous_1"
PeriodX 0.00025
PeriodY 0.0005
PeriodZ 0.00025
PhaseX 0.25
PhaseY 0.5
PhaseZ 0.0
AmplitudeX 25
AmplitudeY 35
AmplitudeZ 0.0
}
Never at rest.
Massimo
Massimo
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Martin, the time of your TimeBase coincide and is up?
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
Fenerit wrote:Martin, the time of your TimeBase coincide and is up?
Sorry, I don't understand. Please, elaborate a bit...
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Enceladus geysers are visible after that TimeBase, so I wonder that if only the julian data of your Celestia was before that data.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
I just re-tested your volcanoes addon. Well, after time 2454854.77083, it doesn't work at all.
But why this date ? The volcanoes should be ON at any time.
But why this date ? The volcanoes should be ON at any time.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Cham wrote:I just re-tested your volcanoes addon. Well, after time 2454854.77083, it doesn't work at all.
But why this date ? The volcanoes should be ON at any time.
In the first version there was an error that was updated. Try to download again (is updated) and whether also this time doesn't work, well... then, I do not know why.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
Fenerit wrote:In the first version there was an error that was updated. Try to download again (is updated) and whether also this time doesn't work, well... then, I do not know why.
Nope, it doesn't work at all.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Try to save again the ssc's files with your own editor. I do not have further ideas. Anyhow, I'm happy at least the curves works, because an orbital object emitting particles ( as you can see I can't wait for the particle engines), is what that there want for a binary sistems stars+black holes.
Never at rest.
Massimo
Massimo
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
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:
Then paste the text below in a editor and save it as scifi_docks.lua module in the ../celxx/ dir:
Goto Eros. Being on the XY plane, for the moment try to incline a bit the cameraview to see the "depth" of the effect.
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.
Last edited by Fenerit on 11.10.2009, 15:04, edited 1 time in total.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
This is working, but there's a two steps discontinuity jump at some stage which is really annoying. The pink ball is approaching from infinity, then reappears at another location before finally entering Eros. I know the motion is periodic, but there's an error in the trajectory.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Cham wrote:This is working, but there's a two steps discontinuity jump at some stage which is really annoying. The pink ball is approaching from infinity, then reappears at another location before finally entering Eros. I know the motion is periodic, but there's an error in the trajectory.
Yes, indeed. PhaseY should be = to PhaseX. I've corrected the code now.
Never at rest.
Massimo
Massimo
Re: Three Lissajous curves
No, there's still a mistake (discontinuity jump in the motion). Just follow the ball and watch Eros approaching :
cel://PhaseLock/Sol:Eros:Scifi_docks%20 ... rc=0&ver=3
cel://PhaseLock/Sol:Eros:Scifi_docks%20 ... rc=0&ver=3
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorFenerit
- Posts: 1880
- Joined: 26.03.2007
- Age: 17
- With us: 17 years 8 months
- Location: Thyrrenian sea
Re: Three Lissajous curves
Sorry, Martin there must be an incomprehension: I do not see jumps in the motion. Below there is a video made at 10x time.
http://marauder.webng.com/files/docks.avi 320x240 Xvid, 479kb
When Eros is toggled with ALT+rightarrow is seen as the motion is a spiral. Whether for "jump in the motion" you intend the jump once the ball is inside Eros to out, this is willingly introduced because the motion has been accomplished, the spaceship is in the dock. That motion must be consider as a "fragment" a "scene" of an action. The inverse motion (from the bay to hyperspace) is due to the furthers equations. Both motions are not close orbit as the former three.
http://marauder.webng.com/files/docks.avi 320x240 Xvid, 479kb
When Eros is toggled with ALT+rightarrow is seen as the motion is a spiral. Whether for "jump in the motion" you intend the jump once the ball is inside Eros to out, this is willingly introduced because the motion has been accomplished, the spaceship is in the dock. That motion must be consider as a "fragment" a "scene" of an action. The inverse motion (from the bay to hyperspace) is due to the furthers equations. Both motions are not close orbit as the former three.
Never at rest.
Massimo
Massimo