Celestia/Celx Scripting/CELX Lua Methods/CEL command synchronous
synchronous
[edit | edit source]synchronous { }
Orbit the currently selected object in synchronous orbit mode. This activates the geographic or 1.6.0 bodyfixed Coordinate System. The geographic or 1.6.0 bodyfixed Coordinate System allows you to remain in a stationary, or geosynchronous orbit above the selected object (not just Earth). As the object rotates below, the camera moves with it, as if it were attached to the object.
In the geographic or 1.6.0 bodyfixed Coordinate System, the axes rotate with the selected object. The Y axis is the axis of rotation – counter-clockwise, so it points north for prograde rotators like Earth, and south for retrograde rotators like Venus. The X axis points from the center of the object to the intersection of its zero longitude meridian and equator. The Z axis (at a right angle to the XY plane) completes the right-handed coordinate system. An object with constant geographic coordinates will thus remain fixed with respect to a point on the surface of the object.
The select command must be used first, to select an object.
The command has no arguments.
CELX equivalent-1:
Based on the celestia:newframe() and observer:setframe() methods.
- Find the target object with name <string> to be in synchronous orbit with and store in "objectname".
objectname = celestia:find( <string> )
- Create new frame of reference to planetographic with "objectname" as reference object and store in "frame".
frame = celestia:newframe("planetographic", objectname)
- Get observer instance of the active view and set the coordinate system of the frame of reference to "frame".
obs = celestia:getobserver() obs:setframe(frame)
Summarized:
objectname = celestia:find( <string> ) frame = celestia:newframe("planetographic", objectname) obs = celestia:getobserver() obs:setframe(frame)
CELX equivalent-2 for Celestia version 1.6.0 and later:
Based on the celestia:newframe() and observer:setframe() methods.
- Find the target object with name <string> to be in synchronous orbit with and store in "objectname".
objectname = celestia:find( <string> )
- Create new frame of reference to 1.6.0 bodyfixed with "objectname" as reference object and store in "frame".
frame = celestia:newframe("bodyfixed", objectname)
- Get observer instance of the active view and set the coordinate system of the frame of reference to "frame".
obs = celestia:getobserver() obs:setframe(frame)
Summarized:
objectname = celestia:find( <string> ) frame = celestia:newframe("bodyfixed", objectname) obs = celestia:getobserver() obs:setframe(frame)
CELX equivalent-3:
Based on the observer:synchronous() method.
- Find the target object with name <string> to be in synchronous orbit with and store in "objectname".
objectname = celestia:find( <string> )
- Get observer instance of the active view and activate synchronous-mode on "objectname".
obs = celestia:getobserver() obs:synchronous(objectname)
Note: Synchronous-mode is the same as setting the frame of reference to planetographic (a.k.a. geographic or 1.6.0 bodyfixed) with "objectname" as reference object.
Summarized:
objectname = celestia:find( <string> ) obs = celestia:getobserver() obs:synchronous(objectname)
Example:
This example selects Earth and sets the Coordinate System to planetographic / geographic / bodyfixed (synchronous).
CEL:
select { object "Sol/Earth" } synchronous { }
CELX with the celestia:newframe() and observer:setframe() methods:
earth = celestia:find("Sol/Earth") celestia:select(earth) frame = celestia:newframe("planetographic", earth) obs = celestia:getobserver() obs:setframe(frame)
CELX with the celestia:newframe() and observer:setframe() methods for Celestia version 1.6.0 and later:
earth = celestia:find("Sol/Earth") celestia:select(earth) frame = celestia:newframe("bodyfixed", earth) obs = celestia:getobserver() obs:setframe(frame)
CELX with the observer:synchronous() method:
earth = celestia:find("Sol/Earth") celestia:select(earth) obs = celestia:getobserver() obs:synchronous(earth)