.cel script "orbitmode" command

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

.cel script "orbitmode" command

Post #1by don » 20.07.2003, 17:47

In .cel scripting, since only one of the following items can be active at any given time (correct?) ...
* chase
* follow
* lock
* synchronous (orbit)
... maybe all of these individual commands should be wrapped up into a single parent command, like "orbitmode", where only one of these items can be selected?

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #2by chris » 20.07.2003, 19:00

This is in fact what the setframe command does; each of what you call orbit modes actually defines a coordinate system. For example the follow command sets the coordinate system to one centered on the currently selected object.

The coordinate system names accepted by setframe map to Celestia's modes as follows:

equatorial - follow
geographic - synchronous
lock - lock
chase - chase
universal - no mode selected (e.g. you just pressed ESC)

All of the frames except for universal require a reference object, speficied by the ref field of the setframe command. The lock coordinate system is defined with two objects, called the reference and the target. As an example, the following two scripts set up the same coordinate system:

The long way:

Code: Select all

select { "Sol/Earth" }
follow { }
select { "Sol/Earth/Moon" }
lock { }


The setframe way:

Code: Select all

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


Hopefully this also answers your question about what setframe is used for.

--Chris

Guest

Post #3by Guest » 20.07.2003, 21:30

Thank you for explaining this Chris.

A little birdie was telling me this as I looked at the setframe command, but the list from Selden has "look" instead of "lock" (which answers another question I had that hasn't even made it here yet <smile>), and some of the other coordsys names did not correspond.

Now it's as clear as a Colorado afternoon in the summer! 8)

Thanks again!

-Don

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #4by don » 20.07.2003, 21:46

Sorry 'bout the "Guest". The forum seems to forget who I am from time to time <laughing>.

-Don


Return to “Development”