lightdelay not working from within celx

Report bugs, bug fixes and workarounds here.
Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 8 months
Location: Victoria, BC Canada

lightdelay not working from within celx

Post #1by cpotting » 22.09.2004, 17:04

It seems that the lightdelay function does not work when implemented from within a celx script. I am running the Celestia 1.3.2 under Windows XP. The follow code should illustrate the problem:

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)
Clive Pottinger
Victoria, BC Canada

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: lightdelay not working from within celx

Post #2by Harry » 22.09.2004, 18:38

cpotting wrote:It seems that the lightdelay function does not work when implemented from within a celx script. I am running the Celestia 1.3.2 under Windows XP. The follow code should illustrate the problem: [...]

It looks like a CELX problem, but AFAICS isn't. The problem occurs also in normal usage of Celestia:

Try toggling LT first after selecting Earth, then after selecting Jupiter. Not sure what Celestia takes into account for it's LT-calculations, but apparently not the true distance between observer and object. Maybe Fridger can comment?

Harald


Return to “Bugs”