Planet vector of travel around the galaxy

All about writing scripts for Celestia in Lua and the .cel system
Topic author
jiveabillion
Posts: 4
Joined: 07.07.2013
With us: 10 years 10 months

Planet vector of travel around the galaxy

Post #1by jiveabillion » 18.07.2013, 16:56

Would it be possible to show the vector each planet is traveling in its path around the galaxy with a script?

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 61
With us: 16 years 2 months
Location: The Netherlands

Re: Planet vector of travel around the galaxy

Post #2by Marco Klunder » 29.07.2013, 20:41

Hello jiveabillion,

It is possible in scripts to show velocity vectors for objects in Celestia, within a script.
It is however the design of Celestia, what these velocity vectors represent.
And your question, regarding the path around the galaxy is not (yet) one of the possibilities.

Objects have their orbits (or static positions) defined within Celestia (-addons) configuration files.
The velocity vector that can be shown within a script, represents the direction an object is moving in these pre-defined orbits.
It is even possible to give a vector a size, which may be determined/calculated as the result of its current velocity within its orbit.
All this can be done with the object:addreferencemark() / object:removereferencemark() CELX methods.

See: http://en.wikibooks.org/wiki/Celestia/Celx_Scripting/CELX_Lua_Methods/Celx_object#addreferencemark
http://en.wikibooks.org/wiki/Celestia/Celx_Scripting/CELX_Lua_Methods/Celx_object#removereferencemark
for more detail explenation of these scripting methods.

Example:

Code: Select all

moon=celestia:find("Sol/Earth/Moon")
refmarktable5={}
refmarktable5.type = "velocity vector"
refmarktable5.size = 2000
refmarktable5.color = "green"
refmarktable5.opacity = 1.0
refmarktable5.tag = "Speedvector"
moon:addreferencemark(refmarktable5)
wait(10)
moon:removereferencemark(refmarktable5.tag)
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621


Return to “Scripting”