Code: Select all
KM_PER_MLY = 9466411.842
EARTH = celestia:find("Sol/Earth")
JUPITER = celestia:find("Sol/Jupiter")
celestia:requestkeyboard(false)
celestia:settime(celestia:tojulianday(2004,10,15,06,32,00))
jupiter_to_earth_vector_universal = JUPITER:getposition() - EARTH:getposition()
jupiter_to_earth_vector_normalized = jupiter_to_earth_vector_universal:normalize()
jupiter_to_earth_vector_backabit = (EARTH:radius() * 5) / KM_PER_MLY * jupiter_to_earth_vector_normalized
-- position above earth where jupiter is visible
celestia:getobserver():track(JUPITER)
celestia:getobserver():goto({duration=5,
to=(EARTH:getposition() + jupiter_to_earth_vector_backabit),
finalOrientation=UP})
celestia:getobserver():setfov(math.rad(0.01))
celestia:setrenderflags{lightdelay=false}
celestia:setlabelflags{moons=true}
flags = celestia:getrenderflags()
while flags.lightdelay == false do
celestia:print("lightdelay is off.\nNotice that Io can be seen\n" ..
"just emerging from behind Jupiter. Also note the\n" ..
"positions of Callisto and Europa\n" ..
"Press - to turn on lightdelay",
2, -1, 1, 10, -2)
wait(0.1)
flags = celestia:getrenderflags()
end
while flags.lightdelay == true do
celestia:print("lightdelay is on.\nIo now appears behind the disc of\n" ..
"Jupiter. Callisto and Europa appear to jump backward\n" ..
"in their orbits; as they should\n" ..
"Press - to turn off lightdelay",
2, -1, 1, 10, -2)
wait(0.1)
flags = celestia:getrenderflags()
end
celestia:flash("Okay, my turn. I will now turn on lightdelay...", 5)
wait(5)
celestia:setrenderflags{lightdelay=true}
celestia:print("Note the LT in the upper right corner denoting that\n"..
"lightdelay is on, yet Io still appears and Europa and\n" ..
"Callisto did not move - that's not right",
10, -1, 1, 10, -2)
wait(10)