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?
.cel script "orbitmode" command
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
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:
The setframe way:
Hopefully this also answers your question about what setframe is used for.
--Chris
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
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!
Thanks again!
-Don
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!
Thanks again!
-Don