Code: Select all
function asseenfrom(observer, name, travelduration, waitduration)
travelduration = travelduration or 10
waitduration = waitduration or 7
observer:goto(celestia:find(name), travelduration)
wait(0.75 * travelduration)
-- A travelduration coefficient of 0.325 is good when the travelduration is 5.
-- A travelduration coefficient of 0.3 is good when the travelduration is 10.
-- A travelduration coefficient of 0.25 is good when the travelduration is 30.
celestia:flash("As seen from " .. name, waitduration +
(0.0001*travelduration^2 - 0.0065*travelduration + 0.355)
* travelduration)
wait(0.5 * waitduration)
celestia:setrenderflags{constellations = true}
-- celestia:showconstellations()
wait(0.5 * waitduration)
celestia:setrenderflags{constellations = false}
end
-- Set time to 3:43 AM CDT on July 21.
celestia:settime(celestia:utctotdb(2011, 7, 21, 8, 43, 0))
-- TODO: Select nothing.
-- TODO: Follow nothing.
celestia:unmarkall()
-- celestia:settextcolor(177/256, 177/256, 254/256)
-- celestia:hideconstellations()
celestia:setconstellationcolor(0.125, 0.125, 0)
celestia:setconstellationcolor(0.4, 0.4, 0, {"Ursa Major"})
-- celestia:showconstellations{"Ursa Major"}
-- Brighten the stars of the Big Dipper.
celestia:setrenderflags{markers = true}
for i, star in ipairs({"Alkaid", "Mizar", "Alioth", "Megrez", "Phecda", "Merak", "Dubhe"}) do
celestia:find(star):mark("white", "disk", 5, 0.75)
end
-- Mark Castor and Pollux so they can be seen from Aldebaran.
for i, star in ipairs({"Castor", "Pollux"}) do
celestia:find(star):mark("purple", "filledsquare", 7, 0.75)
end
observer = celestia:getobserver()
-- Always remain looking at the Big Dipper.
-- The view from Duluth is not horizontal if Phecda is tracked here.
observer:track(celestia:find("Phecda"))
-- asseenfrom(observer, "Sol/Earth")
earth = celestia:find("Sol/Earth")
observer:synchronous(earth)
observer:gotolonglat(earth, math.rad(-92.098194), math.rad(46.786939), earth:radius() * 2, 0)
-- Without this wait, the observer does not go to the above latitude and longitude.
wait(0)
observer:gotosurface(earth)
wait(5)
celestia:flash("As seen from Duluth")
wait(5)
-- Always remain looking at the Big Dipper.
-- The view from Duluth is horizontal if Phecda is tracked here.
--observer:track(celestia:find("Phecda"))
asseenfrom(observer, "Regulus")
asseenfrom(observer, "Pollux")
asseenfrom(observer, "Castor")
asseenfrom(observer, "Aldebaran")
asseenfrom(observer, "Sol/Earth")
(Don’t worry about the math and waiting in asseenfrom(). They just make text appear and disappear exactly when I want it to. The goto() is the only line in asseenfrom() that is relevant to my questions.)
From Earth, I want the Big Dipper to appear as from Duluth, MN, USA (about 47W 92N) at 3:43 AM on July 21st, which is close to horizontal and upright. If I start tracking Phecda before going to Earth’s surface, then I don’t end up horizontal on the surface. The horizon is diagonal when “As seen from Duluth” appears toward the beginning of the script. If I don’t start tracking Phecda until after going to Earth’s surface, then I do stand horizontally on the surface. However, the Big Dipper does not stay centered on the screen when I do this. How can I land horizontally on the Earth while tracking Phecda?
As the camera moves from Earth or star to star, I don’t want the zenith to change. The view from each star should be identical to the matching photo from the above webpage. How do I perform a goto without rolling?
I might want to change the object that I’m tracking because I don’t like how Phecda never moves in my current script. It would be nice to track a point between Phecda and Megrez so they both revolve as the camera moves about. I don’t know the best way to achieve this; whether to create a position in my script or to add an invisible star that is between them to the star catalog and then track it. Would this make my goals easier or more difficult, or would it be the same?