Page 1 of 1

.cel script "orbitmode" command

Posted: 20.07.2003, 17:47
by don
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?

Posted: 20.07.2003, 19:00
by chris
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

Posted: 20.07.2003, 21:30
by Guest
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

Posted: 20.07.2003, 21:46
by don
Sorry 'bout the "Guest". The forum seems to forget who I am from time to time <laughing>.

-Don