Celestia/Celx Scripting/CELX Lua Methods/CEL command setframe

setframe
setframe { ref  target  coordsys  } 

Set the currently active Coordinate System.

CELX equivalent:

Based on the celestia:newframe and observer:setframe methods.


 * Find and select the reference object with name  and store in "objectname_ref". Not needed for frame type "universal".

objectname_ref = celestia:find(  ) celestia:select(objectname_ref)


 * Find the target object with name  which must be locked with "objectname_ref" and store on "objectname_tar". Only needed for frames of type lock.

objectname_tar = celestia:find(  )


 * Create new reference frame and store in "frame".  describs the type of frame and can be one of the following:
 * "universal", "ecliptic", "equatorial", "planetographic", "observer", "lock", "chase", "bodyfixed".
 * In Celestia version, the name "bodyfixed" will replace "planetographic", although for compatibility reasons, the name "planetographic" will continue to work.

frame = celestia:newframe( , objectname_ref, objectname_tar)


 * 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_ref = celestia:find(  ) celestia:select(objectname_ref) objectname_tar = celestia:find(  ) frame = celestia:newframe( , objectname_ref, objectname_tar) obs = celestia:getobserver obs:setframe(frame)

Example: The following example sets the Coordinate System to lock, which locks the Earth and Moon together on the display.

CEL:

setframe { ref "Sol/Earth" target "Sol/Earth/Moon" coordsys "lock" }

CELX with the celestia:newframe and observer:setframe methods:

earth = celestia:find("Sol/Earth") celestia:select(earth) moon = celestia:find("Sol/Earth/Moon") frame = celestia:newframe("lock", earth, moon) obs = celestia:getobserver obs:setframe(frame)

Back to CEL command index