Scripts and Barycenters

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Scripts and Barycenters

Post #1by Malenfant » 22.11.2005, 18:49

It would seem that Barycenters do not follow the general hierarchy that other objects use in Celestia - a star orbiting a Barycenter is not a 'child' of the Barycenter. Whereas a planet orbiting a star is a 'child' of the star, and a moon orbiting a planet is a 'child' of the planet.

Aside from the general inconsistency of implementation, this causes problems for celx script-writers since it seems there's no obvious way to use barycenters in a script. For example, I wanted to write a script where the user selected a barycenter and then activated the script that would take the observer to a distance from the barycenter where the stars orbiting it fit exactly inside the field of view. But without the ability to find the children of the barycenter, this (apparently) becomes impossible.

Is there any way to get around this problem or correct this implementation inconsistency? Probably the easiest way would be to add something to Celestia's code that looked for "OrbitBarycenter" in the stc and if it found it assigned that Barycenter as the parent of the star? Otherwise the only way to correct this would be to change how barycenters are declared which would be somewhat problematic I'd guess.
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #2by Cham » 22.11.2005, 18:58

Yes, this is an annoying problem. And we can't see the stars orbit around their common CM, which is also very annoying. I'm not sure how this could be solved. Its related to the precision Celestia needs, to place the different hierarchical objects.
"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!"

jll
Posts: 64
Joined: 12.06.2002
With us: 22 years 5 months

Post #3by jll » 22.11.2005, 20:59

A workaround that i used in celestia before 1.4 is to define the barycenter as a star with an important AppMag (ex 60).
The star thus defined is near "invisible" in normal use.

Look at He2-104 at celestiamotherlode.net.

i hope this will help you

Bye
jll
AMD Ath1800+ 512mb : Nvidia GeForce6200 AGP 256mb
WinXPPro:FS1280x1024x32:
Celestia 1.4.1:Earth 4Kdds:Clouds 4Kdds:Night 4Kdds:Moon 4kdds:Galaxy ON

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #4by Malenfant » 23.11.2005, 19:05

jll wrote:A workaround that i used in celestia before 1.4 is to define the barycenter as a star with an important AppMag (ex 60).
The star thus defined is near "invisible" in normal use.

Look at He2-104 at celestiamotherlode.net.

i hope this will help you

Bye
jll


That might help in specific cases, but not generally.
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system


Return to “Development”