Sun vs. Planets - size comparison script

Description: All about writing scripts for Celestia in Lua and the .cel system

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#1by don » 13.11.2003, 22:47

*****************************************
*
* EDITED NOV 23, 2003:
*
* Displayed code is now version 1.0.4.
*
* Script file URL now points to version 1.0.4.
*
*****************************************


Howdy Everyone,

Here is a slightly modified version of Christoria's 2 million km comparison script, ready for testing. Please report bugs here so we can modify the posted script code for everyone else.

Thank you!

-Don G.
-----------------------------------------
Added:
If you prefer to download the script file, here is a direct link to it: http://www.donandcarla.com/Celestia/cel_scripting/SunAndPlanetsSizeComparison_1_0_4.cel.txt. Just right-click and save. When you save the file, remove the trailing ".txt" part of it.

And here is my Celestia web page with other .CEL script files: http://www.donandcarla.com/Celestia/
-----------------------------------------

Code: Select all

{

#------------------------------------------------------------------------+
#                                                                        |
# FileName: SunAndPlanetsSizeComparison_1_0_4.cel                        |
# FileType: Celestia .CEL Script (See http://www.shatters.net/celestia/) |
#                                                                        |
# PostDate: October 31, 2003 (original posting date)                     |
#  Version: 1.0.4                                                        |
# Last Mod: Nov 22, 2003                                                 |
#                                                                        |
#  Purpose: Display our solar system planets to compare their size to    |
#           the sun, at a distance of two million km.                    |
#                                                                        |
#   Author: Christoria (User=christoria on the Celestia Forums):         |
#           See http://shatters.net/forum/viewforum.php?f=9              |
#                                                                        |
#  License: Free for personal use. For any other use, contact Author.    |
#                                                                        |
#------------------------------------------------------------------------+
# Modified by Don Goyette (User=don on the Celestia Forums) on November  |
# 13, 2003 to move some code from inside of "goto...wait" and "print...  |
# wait" statements, to outside of those statements. Along with a few     |
# other changes and additions.                                           |
#                                                                        |
# Modified by Bob Hegwood on Nov 16, 2003 to obtain more accurate two    |
# million km planet distances, and made a couple of spelling changes.    |
#                                                                        |
# Modified by Don Goyette on November 17, 2003. More text changes and    |
# additions, and put back a couple of things that Bob changed, since     |
# this version is for the basic Celestia distribution package and his    |
# version is for the planet add-ons he has installed on his system.      |
#                                                                        |
# Modified by Bob Hegwood on Nov 22, 2003 for distance modifications     |
# made necessary by changes in planetary radii. Made minor text changes. |
#------------------------------------------------------------------------+


#------------------------------------------------------------------------+
#                                  Setup                                 |
#------------------------------------------------------------------------+
# Do not render the following objects...
  renderflags { clear "orbits|constellations|comettails|boundaries|markers" }
  renderflags { clear "eclipseshadows|pointstars|nightmaps|galaxies" }
  renderflags { clear "planets|stars" }

# Render the following objects...
    renderflags { set "cloudmaps|ringshadows" }

# Do not label the following objects...
  labels { clear "planets|moons|spacecraft|asteroids|constellations|stars|galaxies" }

# Set Ambient Light Level (0.0 to 1.0 is a good Lo-Hi range)...
  set { name "AmbientLightLevel" value 0.40 }

# Set Field of View (Celestia 1.3.1 dflt = 25)...
  set { name "FOV" value 27.5 }

# Set visible star Magnitude (Celestia UI: 0.8 to 15.2, dflt=6.0)...
  setvisibilitylimit { magnitude 8.0 }

# Set the time multiplier...
  timerate { rate 1 }

# Set Date and Time...
  time { jd 2452950.34359 }


#------------------------------------------------------------------------+
#                             Script Body                                |
#------------------------------------------------------------------------+
#
# At this point, stars and planets are NOT displayed, so we can put a nice
# text description of the script on the screen.
#
# The length of sentences are defined for an 800x600 display, which is about
# 50 to 60 characters.
#
  wait { duration 3 }

  print { origin "topleft"  row 11  column 1  duration 18
text "Welcome to the Sun vs. Planets size comparison script.\n\nThis script first displays our Sun at a distance of 2\nmillion km. Then, it displays each of the planets in\nour solar system, at approximately the same 2 million\nkm distance, for size comparison.\n\n(To end this script at any time, press the ESC key.)" }

  wait { duration 18 }

  print { origin "topleft"  row 11  column 1  duration 15
text "Before we get started, lets remove a little distraction ...\n\nPress the 'v' key on your keyboard until there is NO text\ndisplayed in any of the window corners ..." }

  wait { duration 13 }

  print { origin "topleft"  row 11  column 1  duration 15
text "Also, if you happen to see small green text (Locations)\ndisplayed on the screen when we visit a planet, press\nthe '&' key to turn this off." }

  wait { duration 13 }


#------------------------------------------------------------------------+
#                          Start at Sol, our Sun                         |
#------------------------------------------------------------------------+
  select { object "Sol" }

  print { row -4  column 1  duration 5  text "First stop, our Sun ..." }
  wait { duration 5 }

# Define the starting Coordinate System, Camera Position and Orientation...
  setframe { ref "Sol"  coordsys "universal" }

  setposition {
    base   [ 0.003261867430402947 -3.555640827885698e-007 6.174173227554632e-007 ]
    offset [ 1.25510712933874e-013 5.421010862427522e-019 3.236343484869231e-017 ] }

  setorientation {
    angle 1.99055
    axis  [ -0.0333064 -0.340652 0.939599 ] }

  goto { time 2  distance 10.05999 }
  wait { duration 2 }

# Rotate the Sun so it shows a smiley face...
  rotate { duration 0.11
           rate 1000
           axis [0 0 1] }
  wait { duration 0.11 }

  renderflags { set "stars|planets" }  # Turn on stars

# Speed up time so we can see the Sun rotating...
  timerate { rate 15000.0 }

  print { text "There's our huge Sun, smiling down on us.\nCurrent distance: 7 million km."  row -5  column 2  duration 9 }
  wait { duration 9 }

  print { text "Let's zoom in to 2 million km -- our comparison distance.\nThen, we'll observe each of the planets from about the\nsame distance."
          row -5  column 2  duration 9}
  wait { duration 9 }

  changedistance { duration 3.15 rate -0.5 }
  wait { duration 3.15 }
  wait { duration 2 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

# Turn off star display so we can display some text...
  renderflags { clear "stars" }

  print { text "Now THAT is HUGE!!!\nEven at a distance of 2 MILLION km! WOW!"
          row -4  column 1  duration 7 }
  wait  { duration 7 }

# Rotate the Sun back to it's normal position...
  rotate { duration 0.11
           rate -1000
           axis [0 0 1] }
  wait { duration 0.11 }


#------------------------------------------------------------------------+
#                                   Mercury                              |
#------------------------------------------------------------------------+
# NOTE: Since white text does not show up on a white sun, we have to
#       move the sun out of the way before displaying any text...

  select { object "Mercury" }
  center { time 1 }

  print { text "Next stop: Mercury, planet #1 ..."
          row -4  column 2  duration 3 }
  wait { duration 4 }

  follow { }

  goto { time 3 distance 8 }
  renderflags { set "stars" }  # (We turned this off above)
  wait { duration 3 }

# Speed up time so we can see the planet rotating...
  timerate { rate 70000.0 }

  print { text "There's Mercury, at a pretty close distance of only\n17 thousand km."
          row -4  column 2  duration 8 }
  wait { duration 8 }

  print { text "Did you know that Mercury's surface temperatures range\nfrom 90 degrees K to 700 degrees K. Now that's HOT!"
          row -4  column 2  duration 8 }
  wait { duration 8 }

  print { text "Let's go to 2 million km away, like we did at the sun ..."
          row -4  column 2  duration 6 }
  wait { duration 6 }

  goto { time 5  distance 820.688 }
  wait { duration 5 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "Wow! This is the same 2 million km distance we just viewed\nthe sun at, and Mercury is just a tiny little dot!"  row -4  column 2  duration 8 }
  wait { duration 8 }

  print { text "Now let's check out Venus, planet #2.\nWatch Mercury go bye bye ..."
          row -4  column 2  duration 7 }   
  labels { set "planets" }  # (To see where Mercury is)
  wait { duration 7 }


#------------------------------------------------------------------------+
#                                  Venus                                 |
#------------------------------------------------------------------------+
  select { object "Venus" }
  center { time 2 }
  follow { }

  goto { time 5 distance 8 }
  wait { duration 5 }
  labels { clear "planets" }

# Speed up time so we can see the planet rotating...
  timerate { rate 6000.0 }

  print { text "Here's Venus, at a distance of 42 thousand km. Notice\nhow it rotates in the -opposite- direction as the other\nplanets. This is called a 'retrograde' rotation."
          row -5  column 2  duration 15 }
  wait { duration 15 }

  print { text "Let's go out to 2 million km ..."
          row -4  column 2  duration 5 }
  wait { duration 5 }

  goto { time 6 distance 331.5}
  wait { duration 6 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "It's almost gone, but you can still see it! Quite small\ncompared to the Sun at 2 million km, wouldn't you say?"
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Next, let's go to our home planet, Earth:\nthird rock from the Sun, planet #3 ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }


#------------------------------------------------------------------------+
#                                    Earth                               |
#------------------------------------------------------------------------+
  select { object "Earth" }
  center { time 1 }
  follow { }

  goto { time 5 distance 8 }
  wait { duration 5 }

# Speed up time so we can see the planet rotating...
  timerate { rate 1000 }

  print { text "Our Big Blue Marble sure is beautiful.\nWe're at a distance of 45 thousand km right now."
          row -4  column 2  duration 8 }
  wait { duration 8 }

  print { text "How many Earths do you think can fit inside the Sun?"
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "With a radius of 6,378 km, over one million Earths\ncan fit inside the Sun!!!  WOW!"
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Time for the 2 million km comparison ..."
          row -4  column 2  duration 4 }
  wait { duration 4 }

  goto { time 6 distance 314.65 }
  wait { duration 6 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "Now at a distance of 2 million km -- Pretty small.\nHere's a little more Earth trivia for you ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Earth's mass is 6,000,000,000,000,000,000,000,000 kgs!\nThat's 6x10E24 kgs, which is how scientists and engineers\nwrite that huge number."
          row -5  column 2  duration 10 }
  wait { duration 10 }

  print { text "Let's set off for Mars, the 'Red planet', #4 ..."
          row -4  column 2  duration 5 }
  wait { duration 5 }


#------------------------------------------------------------------------+
#                                   Mars                                 |
#------------------------------------------------------------------------+
  select { object "Mars" }
  center { time 1 }
  follow { }

  goto { time 5 distance 8 }
  wait { duration 5 }

# Speed up time so we can see the planet rotating...
  timerate { rate 1500 }

  print { text "There's Mars, and now you know why it's called\nthe 'Red planet'. We're at a distance of 24 thousand km."
          row -4  column 2  duration 10 }
  wait { duration 10 }

  print { text "Mars is where the Sojourner Rover landed, on the 4th of July,\n1997. It was a small, 6-wheeled, remotely controlled vehicle."
          row -4  column 2  duration 10 }
  wait { duration 10 }

  print { text "Out to 2 million km, shall we?"
          row -4  column 2  duration 5 }
  wait { duration 5 }

  goto { time 6 distance 590.4 }
  wait { duration 5 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "We're still not able to see much of this planet either."
          row -4  column 2  duration 5 }
  wait { duration 5 }


#------------------------------------------------------------------------+
#                                   Jupiter                              |
#------------------------------------------------------------------------+
  print { text "Now, on to some bigger planets -- much bigger --\nthe Gas Giants. First stop is Jupiter, planet #5 ..."
          row -4  column 2  duration 10 }
  wait { duration 10 }

  select { object "Jupiter" }
  center { time 1 }
  follow { }

  goto { time 8 distance 8 }
  wait { duration 8 }

# Speed up time so we can see the planet rotating...
  timerate { rate 2000 }

  print { text "We are 500 thousand km away! Remember when we\nlooked at Mercury? It was a mere 17 thousand km away."
          row -4  column 2  duration 10 }
  wait { duration 10 }
  timerate { rate 800 }

  print { text "The Great Red Spot on Jupiter is actually a huge (23,000\nkm by 12,400 km) hurricane-like storm that has lasted\nfor over 300 years."
          row -5  column 2  duration 9 }
  wait { duration 9 }

  print { text "Will Jupiter look as big as the Sun at 2 million km away?\nLet's see ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  goto { time 3 distance 29.02 }
  wait { duration 3 }
  timerate { rate 1000 }

  print { text "Hey, we can still see it! Jupiter is the largest\nplanet in our Solar System."
          row -4  column 2  duration 9 }
  wait { duration 9 }


#------------------------------------------------------------------------+
#                                  Saturn                                |
#------------------------------------------------------------------------+
  select { object "Saturn" }

  print { text "And now, to the planet with the best rings:\nSaturn, planet #6 ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  center { time 1 }
  follow { }

  goto { time 8  distance 8  up [ 0 1 0 ]  upframe "equatorial" }
  wait { duration 8 }

  print { text "Saturn, at 422 thousand km away.\nWhat a cool planet!"
          row -4  column 2  duration 5 }
  wait { duration 5 }
  orbit { axis [ 0 1 0 ] rate 30 duration 12 }

  print { text "We could watch this one for a while, but\n2 million km coming up ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  goto { time 6 distance 34.16 }
  wait { duration 6 }

# Speed up time so we can see the planet rotating...
  timerate { rate 1500 }

  print { text "Still looks cool.\nLike Jupiter, Saturn is also a Gas Giant."
          row -4  column 2  duration 9 }
  wait { duration 9 }

  print { text "Want some more trivia?"
          row -4  column 2  duration 5 }
  wait { duration 5 }

  print { text "Saturn is the only planet, that if put in water ...\nwould float!"
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Tell me that ain't cool.\nSaturn is definitely cool."
          row -4  column 2  duration 7 }
  wait { duration 7 }


#------------------------------------------------------------------------+
#                                    Uranus                              |
#------------------------------------------------------------------------+
  select { object "Uranus" }

  print { text "Now let's check out Uranus, planet #7.\nThat's pronounced 'YOOR-uh-nus' ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34358 }

  center { time 1 }
  follow { }

  goto { time 5 distance 8 }
  wait { duration 5 }

# Speed up time so we can see the planet rotating...
  timerate { rate 1000 }

  print { text "Uranus, at a distance of 179 thousand km.\nCan you see how the planet is tilted on it's side?"
          row -4  column 2  duration 10 }
  wait { duration 10 }

  print { text "It might look pretty, but uranus has surface winds of\nup to 600 km per hour! That's a bit windy for us humans."
          row -4  column 2  duration 8 }
  wait { duration 8 }

  print { text "Betcha it stays blue at 2 million km.\nWhat do YOU think? . . ."
          row -4  column 2  duration 8 }
  wait { duration 8 }

  goto { time 5 distance 79.25 }
  wait { duration 5 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "Yep, it's still blue. Told ya."
          row -4  column 2  duration 5 }
  wait { duration 5 }


#------------------------------------------------------------------------+
#                                  Neptune                               |
#------------------------------------------------------------------------+
  select { object "Neptune" }

  print { text "It's time to tune into Neptune, planet #8 on our charts ...\nIsn't this fun?"
          row -4  column 2  duration 7 }
  wait { duration 7 }

  center { time 8 }
  follow { }

  goto { time 3 distance 8 }
  wait { duration 3 }

# Speed up time so we can see the planet rotating...
  timerate { rate 800 }

  print { text "What a cool blue!\nWe're at 173 thousand km, which is the closest\nwe've started with the Gas Giants."
          row -5  column 2  duration 9 }
  wait { duration 9 }

  print { text "That dark spot on Neptune is about the size of our\nentire planet Earth."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Neptune's diameter is about 4 times the diameter of Earth."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print { text "Here we go ... 2 million km ..."
          row -4  column 2  duration 5 }
  wait { duration 5 }

  goto { time 5 distance 81.78 }
  wait { duration 5 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "We can still see it."
          row -4  column 2  duration 5 }
  wait { duration 5 }


#------------------------------------------------------------------------+
#                                    Pluto                               |
#------------------------------------------------------------------------+
  select { object "Pluto" }

  print { text "And finally, we'll visit Pluto, planet #9,\nthe smallest planet in our Solar System ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  center { time 1 }
  follow { }

  goto { time 5 distance 8 }
  wait { duration 5 }

# Speed up time so we can see the planet rotating...
  timerate { rate 8000 }

  print { text "We are only 8 thousand km away.\nAt Mercury, we started at 17 thousand km.\nWatch for Charon, Pluto's moon ..."
          row -5  column 2  duration 15 }
  wait { duration 15 }

  print { text "The radius of Pluto is a mere 1151 km, which is SMALLER\nthan Earth's moon! Now that is one tiny planet!"
          row -5  column 2  duration 7 }
  wait { duration 7 }

  print { text "Notice how Pluto rotates in the -opposite- direction\nas the other planets, just like Venus, and it's axis\nis tilted like Earth's."
          row -5  column 2  duration 8 }
  wait { duration 7 }

  print { text "Say adios, ciao, goodbye ...\n2 million km coming right up ..."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  goto { time 5 distance 1739.0 }
  wait { duration 5 }

# Since we sped up time, reset it...
  timerate { rate 1.0 }
  time { jd 2452950.34359 }

  print { text "Oh, and since Pluto is the furthest planet from the Sun,\nit takes 250 Earth years to go around the Sun once."
          row -5  column 2  duration 9 }
  wait { duration 9 }


#------------------------------------------------------------------------+
#                             Time to go Home                            |
#------------------------------------------------------------------------+
  print { text "There you have it:\n\nJupiter is HUGE!\nPluto is ... Hey, where'd Pluto go???"
          row -7  column 2  duration 10 }
  wait { duration 10 }

  select { object "Earth" }
  follow { }
  center { time 10 }

  print { text "As you just saw, the planets in our Solar System vary\ngreatly in size. From tiny little Pluto to huge Jupiter."
          row -4  column 2  duration 10 }
  wait { duration 10 }

  goto { time 20 distance 8 }

  print { text "However, when it comes to size, none of our planets\ncompares to the Sun. Remember how it filled the display\nat 2 million km? None of the planets even came close!\n\nWhat a magnificent Solar System we live in!"
          row -7  column 2  duration 18 }
  wait { duration 18 }

  print { text "And here we are, back at our home planet, Earth.\n... So go home already."
          row -4  column 2  duration 10 }
  wait { duration 10 }


#------------------------------------------------------------------------+
#                                 The End                                |
#------------------------------------------------------------------------+
# Reset visible star Magnitude (Celestia UI: 0.8 to 15.2, dflt=6.0)...
  setvisibilitylimit { magnitude 6.5 }

  print { row -4  column 2  duration 5
text "We hope you enjoyed the Sun vs. Planet size comparison script." }
  wait { duration 5 }

  print { row -6  column 2  duration 10
text "Now that the script is finished, you can display text again.\n\nPress the 'v' key on your keyboard until the text you\nwant to see is displayed." }
  wait { duration 10 }

# Reset Field of View (Celestia 1.3.1 dflt = 25)...
  set { name "FOV" value 25.0 }

  print { text "Press the '!' key to return to your current date and time."
          row -4  column 2  duration 7 }
  wait { duration 7 }

  print  { text "The script is now finished."
           row -4  column 2  duration 5 }
  wait   { duration 5 }

}
Last edited by don on 23.11.2003, 20:33, edited 3 times in total.

JackHiggins
JackHiggins
Posts: 1034
With us: 14 years 9 months
Location: People's Republic Of Cork, Ireland

#2by JackHiggins » 14.11.2003, 00:12

Nice... 8) :D

Very good- although a little slow for me. I imagine this speed would be very good for kids learning etc who this is aimed at!
- Jack Higgins
Jack's Celestia Add-ons
And visit my Celestia Gallery too!

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#3by don » 14.11.2003, 00:47

Howdy Jack,

Thanks for the QUICK response!

Yes, I slowed it down just a tad for the kiddos, and so the person has a chance to actually look at the planets too. :)

Did you catch the "Smiley Sun"? That took a while to get just right.

-Don G.

christoria
christoria
Posts: 74
With us: 13 years 10 months

christoria

#4by christoria » 14.11.2003, 03:14

don,

Read the script and it looks great! Will try it out later today. Thanks for putting much more into it, and fully commenting it.
Thank you,

christoria
-------------
Your stomach has to produce a new layer of mucus every two weeks; otherwise it will digest itself.

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#5by don » 14.11.2003, 06:35

Howdy Christoria,

My pleasure.

Hope everyone enjoys it.

-Don G.

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#6by Bob Hegwood » 14.11.2003, 08:52

Don,

I've run the script, and I love your presentation. The timing was perfect (At least to me), and it presented itself with a *very* professional look.

I'm studying the script to learn how you DID some of those things too. A great little scripting education lies within that code.

On to what I've done with it.

1) I corrected some spelling errors - which we ALL make from time to time.

2) I've corrected SOME of the distance values in order to get closer to the 2 million km distance we're aiming at. Thus far, I've only gotten as far as Mars, because - as you said in another topic - "You wish you could speed up the execution time." It seems that you need to "fudge" the distance values in order to arrive closer to the 2 million km. The Distance=2000000/Radius formula just doesn't get you close enough on some occasions. (Is that why you told the user to use the "V" key? :wink: )


3) I corrected some of the viewing distance text, as you were telling the user that they were farther (or closer) to the object than they were. (At least on MY machine?

4) I've changed a word here and there to make CERTAIN that the user knows that we're simply APPROXIMATING the 2 million km.

5) I'm sending a copy attached to an e-mail as you have done for me.

Let me know what you think. If I have time this weekend (unlikely now that you've gotten me doing God Knows what else in Celestia) I'll try to finish the closer to 2 million km fixes.

By the way, this script is not written just for kids... It's also appreciated by us old geezers too. :)

Take care, Bob
Bob Hegwood
Windows XP-SP2, 256Meg 1024x768 Resolution
Intel Celeron 1400 MHz CPU
Intel 82815 Graphics Controller
OpenGL Version: 1.1.2 - Build 4.13.01.3196
Celestia 1.4.0 Pre6 FT1

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#7by don » 14.11.2003, 18:27

Howdy Bob,

You do know that this is all Christoria's fault! :lol:

He's the one that got both of us going on this script. :)

It has been a fun experience working with it, except for that 2 million km thing, which I too tried tweaking until the cows came home -- literally. :lol:

Thank you for your continued efforts on the script Bob. I tried using some of the 2Mkm figures used in your mod of Christoria's original, but on my system they weren't quite right. See below. I *think* I discovered why we are seeing different distance values!


Bob Hegwood wrote:I'm studying the script to learn how you DID some of those things too. A great little scripting education lies within that code.
As well as within the demo.cel script, which comes with Celestia. I love the orbit command, which I had not played with before. This is how Saturn does it's odd rotate thing.


Bob Hegwood wrote:1) I corrected some spelling errors - which we ALL make from time to time.
Who, me? Nahhhh, musta been someone else. :lol:


Bob Hegwood wrote:2) I've corrected SOME of the distance values in order to get closer to the 2 million km distance we're aiming at.
They should have been okay through Mars (the best the math precision would allow for), and pretty close on the remainder. Hmmm, I wonder why they would be different on different systems. Selden, Christophe, Grant -- any ideas?

One thing I did find out is that position makes a difference (due to craters, ridges, etc.), which means time also plays a part. The date/time and position MUST BE exactly the same for each and every run, or the distances will be different. That's one reason why I reset the jd all the time -- and why I requested the ability to speed up script execution in Celestia.

:idea: Ahhhhhh ... Just came to me ... position -- TEXTURES! I always use the DEFAULT Celestia distribution to create scripts, which means the default textures. I'll BET that you and maybe Christoria are using add-on textures, yes?


Bob Hegwood wrote:(Is that why you told the user to use the "V" key? :wink: )
Only partly. It just plain looks better without all the fast-moving text (time display) due to the speed-ups.


Bob Hegwood wrote:3) I corrected some of the viewing distance text, as you were telling the user that they were farther (or closer) to the object than they were. (At least on MY machine?)
I left the non-2M-km distances the way Christoria had them, except to round the display value up or down.

Once again, non-default TEXTURES come into play here.

This is going to be one for the developers to figure out how to deal with, since different textures / bumpmaps are likely to produce different actual distance-from-the-surface values <sigh>.


Bob Hegwood wrote:4) I've changed a word here and there to make CERTAIN that the user knows that we're simply APPROXIMATING the 2 million km.
Thanks Bob. After reading the text a couple hundred times, the mind starts to ignore it. :(


Bob Hegwood wrote:5) I'm sending a copy attached to an e-mail as you have done for me.
Thanks, I'll go have a looksee!


Bob Hegwood wrote:By the way, this script is not written just for kids... It's also appreciated by us old geezers too. :)

Shhhh, wouldn't want all the kids to know how old we *really* are! :lol:

Thanks again Bob!

-Don G.

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#8by don » 14.11.2003, 19:07

Howdy Bob,

Just ran your version and here are the numbers I came up with, using the default distribution of Celestia...

Code: Select all

Planet    1st Dist   2M Dist
-------  ---------  ---------
Sun      6,998,800  2,000,500
Mercury     17,080  2,000,200
Venus       42,364  2,000,200
Earth       44,647  2,000,000
Mars        23,772  2,001,600
Jupiter    500,440  1,958,900
Saturn     421,880  1,937,700
Uranus     178,910  1,925,500
Neptune    173,360  1,975,400
Pluto        8,057  2,023,500


* The pronunciation for Uranus that I used came from: http://www.nineplanets.org/uranus.html, which is where the Info link (right-click on a planet) takes the user.

* You changed the radius of Pluto text from 1151 to 1137. I used the value used by Celestia. Is this incorrect?

Thanks again Bob!

-Don G.

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#9by Bob Hegwood » 15.11.2003, 09:31

Don,

Looks good up until Jupiter. That's where I ran out of steam and decided to quit for the evening. Since you were originally positioned 2,000,500 km from the Sun, I tried to get as close to that figure as I could. Please be aware that I considered EVERY value less than 2,000,000 as being incorrect. (Sorry, it's just me... I want ACCURACY dammit!) :wink:

In regard to the pronunciation of the planet's name, I was simply trying to make *certain* that the pronunciation was interpreted as the Nine Planets site has pronounced it.

The radius of Pluto was 1137 according to MY "solarsys.ssc." Now why would we have two different radii? I certainly haven't changed it. Curious... I shall investigate. One moment please...

Upon further investigation, the planetary diameter of Pluto is 2274 km. See the Nine Planets Pluto page for the information. That does make the radius 1137 does it not?

I am indeed using addon textures for almost *all* of the planets. This will make a difference in distance calculations? Oh no... As soon as I think I know what I'm doing, someone comes along and tells me I'm doing it wrong again. Sheesh!

At any rate, I'm not finished with it. By the time I *get* finished, the 2,000,000 km distances will be *much* closer. I'm absolutely determined to get them right. Even if they will only work correctly on MY system, then I'll still correct them.

Man, I'm tired now. I've been working on the location files we talked about too.

Let me play with this script again after I've slept for about 12 hours, then maybe I'll be able to make more sense of what's going on here.

Thanks loads for the comments, Don. I ALWAYS learn something new when I talk to you.

Take care, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#10by selden » 15.11.2003, 14:45

Bob,

A quibble: apparently the radius of Pluto is not known to the precision that you're assuming.

http://www-int.stsci.edu/~idash/al_news/Drastic_Expansion_of_Plutos_Atmosphere.html discusses the stellar occultation observations made in July, 2002. Among other things, it mentions that Pluto's surface radius "... is not known ... but should be close to 1160 km."
Selden

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#11by don » 15.11.2003, 19:25

Pluto: Very strange, Of the 3 Celestias I have on my system, 2 show 1151 and one shows 1137.

I think Grant is the keeper of the official Celestia data files, no? Grant, what is the current 1.3.1 pre11 radius value for Pluto?


Bob wrote:(Sorry, it's just me... I want ACCURACY dammit!) :wink:
Sheesh, and I used to think *I* was a stickler for detail. :lol:


Bob wrote:In regard to the pronunciation of the planet's name, I was simply trying to make *certain* that the pronunciation was interpreted as the Nine Planets site has pronounced it.
This is definately a difficult one to get just right.


Bob wrote:I am indeed using addon textures for almost *all* of the planets. This will make a difference in distance calculations?

I am not certain, which is why I posted those values above. Please check them against your install to see if they are different. Then we will know.

Thanks again Bob, for your hard work on getting the 2M km values as close as possible. :D

-Don G.

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#12by Bob Hegwood » 15.11.2003, 21:01

selden wrote:Bob,

A quibble: apparently the radius of Pluto is not known to the precision that you're assuming.


Ooops...

Sorry, Mr. Ball. It never even occurred to me to question the values that the Nine Planets Site displayed. Currently, I'm using the 1137 value which, by the way, CAME with Celestia 1.3.0 I believe. :wink:

Take care, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#13by Bob Hegwood » 15.11.2003, 21:38

Mr. Goyette, :wink:

I have now revised your Size comparison script for the FINAL time. I'll be e-mailing you a copy shortly.

Please note that on MY system, *all* of the 2 million km distances are accurate to within 500 km from the original 2000500 distance we originally start out with. As to the texture having something to do with the distance calculations... I changed a few of my textures just to see what would happen, and NOTHING changed as far as I could tell. The viewing distances AND the 2million km distances stayed exactly the same.
One additional note, however: Almost *ALL* of my textures are now at the same 1024 x 512 resolution, so maybe this test doesn't prove anything. Just thought I'd let you know.

The following is the data as it appears on MY machine:

Code: Select all

            View       Distance
Object      Distance   from Sun
------      --------   --------
Sun                    2000500
Mercury     17080      2000000
Venus       42364      2000200
Earth       44646      2000500
Mars        23758      2000400
Jupiter     499790     2000600
Saturn      422310     2000500
Uranus      183400     2000100
Neptune     173350     2000400
Pluto       7959       2000100


Maybe we can learn from this. At any rate, it's been FUN so far. :)

P.S. - I have 3 more files for you, and I'll be placing them on my web page as requested. They are mars_locs.ssc, moon_locs.ssc, and the venus_locs.ssc files as you requested. First though, let me take a look at the files Mr. Hutchison sent to me. 8O

Take care, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

christoria
christoria
Posts: 74
With us: 13 years 10 months

#14by christoria » 16.11.2003, 04:03

Woah!

I'm glad to see this is working out for other people. I was not even going to post the original because it was really just another test to see if I could script in Celestia.

I'll probably use don's modified script to make a sort of class out of it. Fourty to fifty minutes of solid information.

I'd like to see what other people are scripting. Everyone seems to like them, and we'll all tear 'em apart and fix 'em up anyways. Post away! :P
Thank you,



christoria

-------------

Your stomach has to produce a new layer of mucus every two weeks; otherwise it will digest itself.

Evil Dr Ganymede
Evil Dr Ganymede
Posts: 1386
With us: 14 years 3 months

#15by Evil Dr Ganymede » 16.11.2003, 04:50

*scratches head*

I just downloaded the original script from the top of the thread, and it looks neat, but sometimes my planet textures just disappear completely, and I'm faced with a very bright featureless sphere instead. Seems to happen at random... but when I restart Celestia and look at the planets that had missing textures, they're back in place.

Is that a script problem? This is pretty much the first time I've used the new version (pre11) of Celestia, I was on pre3 before and had no trouble with disappearing textures. Don't think it's a video card problem, unless pre11 does something different to pre3... any ideas?

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#16by Bob Hegwood » 16.11.2003, 10:14

Dr. Ganymede,

Try out the tip that Mr. Selden Ball gave me when experiencing similar problems on my machine when I went from 1.3.0 to 1.3.1 Pre11...

When the problem occurs, press the tilde "~" key to view a log of what's happening on your Celestia screen. (You must press "SHIFT" and "`" on my keyboard.) This will tell you if the textures are being loaded correctly or not.

Also, - after MUCH effort - I found out that 1.3.0 was allowing me to use textures which were actually too large for my simple Windows XP machine. While they worked fine in that version of Celestia, they did NOT work under 1.3.1 Pre11.

My machine can use textures no larger than 1024x512, and when I finally realized what was happening, I simply re-sized the textures using a program called Pixia. This completely cured my problems.

Maybe this helps?

At any rate, take care... Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

Harry
Harry
Posts: 559
With us: 14 years
Location: Germany

#17by Harry » 16.11.2003, 11:38

Evil Dr Ganymede wrote:I just downloaded the original script from the top of the thread, and it looks neat, but sometimes my planet textures just disappear completely, and I'm faced with a very bright featureless sphere instead. Seems to happen at random... but when I restart Celestia and look at the planets that had missing textures, they're back in place.


Don reported a problem with scripts which are not in the main celestia-directory. Try moving the script there and running it from there. This bugs probably seems to be random because it only affects textures loaded while/after(?) the script runs.

HTH,

Harald

Evil Dr Ganymede
Evil Dr Ganymede
Posts: 1386
With us: 14 years 3 months

#18by Evil Dr Ganymede » 16.11.2003, 17:58

Harry wrote:Don reported a problem with scripts which are not in the main celestia-directory. Try moving the script there and running it from there. This bugs probably seems to be random because it only affects textures loaded while/after(?) the script runs.


That seemed to fix it. Thanks! :)

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#19by don » 16.11.2003, 22:50

Good Morning Mr. Hegwood,

Your mission, should you decide to accept it .... oh nevermind <grin>.

Howdy Bob,

The numbers look good! I'll check the FINAL version against a couple different Celestias I have installed, but your test would seem to indicate that texture / bumpmap differences should not make the numbers different. Let's hope <smile>!

Bob Hegwood wrote:P.S. - I have 3 more files for you, and I'll be placing them on my web page as requested. They are mars_locs.ssc, moon_locs.ssc, and the venus_locs.ssc files as you requested.

Thank you Bob. I didn't mean for me specifically, but for anyone else to download too <smile>. I received your e-mails and will be looking things over later. Fingers are not moving too well today <sigh>.

Didn't know that Grant had done some revisions as well, or I would have let you know. Sorry. Let us know how they look.

Ciao for now...

-Don G.

don
Topic author
don
Topic author
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#20by don » 16.11.2003, 23:00

Howdy christoria,

Now you know how hungry some folks are for new scripts to play with <big grin>! Your comparison script is an excellent visual aid in learning how the planets are quite different in size and how they compare in size to the sun.


christoria wrote:I'd like to see what other people are scripting. Everyone seems to like them, and we'll all tear 'em apart and fix 'em up anyways. Post away! :P
Yes, everyone, by all means, please post whatever scripts you may have created in the past, or are working on now -- even if they are not complete or don't work the way you intended. We all love to see new scripts, new ideas, etc. <smile>.


christoria wrote:I'll probably use don's modified script to make a sort of class out of it. Fourty to fifty minutes of solid information.

Are you a teacher?

You might want to wait for Bob's final version, since the 2M km planet distances will all be within 500 km. Once I check it, I'll post it here and add it to my web site, as Bob may do also.

-Don G.


Return to “Scripting”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests