Page 1 of 1
'lock' 2 objects via .CEL script?
Posted: 19.07.2003, 01:56
by don
If someone knows how to lock two objects via .CEL script, could you please show an example?
The lock command doesn't take any arguments, and the select command only takes ONE object argument, so I'm not sure how to do this. The following code locks only Earth ...
Code: Select all
select { object "Sol"}
lock {}
select { object "Earth" }
lock {}
Thank you!
-Don
Posted: 19.07.2003, 02:01
by don
Also, could someone explain to me exactly what lock does? Yes, I know it "locks" an object or two together, but for what purpose? How does the view change?
Posted: 19.07.2003, 02:02
by chris
The command sequence is the same as if you were using the keyboard:
Code: Select all
select { object "Earth" }
follow {}
select { object "Sol" }
lock {}
This will maintain your position with respect to the center of the Earth, and keep both the Sun and the Earth at a fixed location in your view. It's the same as if you typed 3 f 0 :
--Chris
Posted: 19.07.2003, 02:23
by don
Hi Chris,
Just tried your code example, and the display says "Lock Earth -" ... no "Sol".
In your keystroke example, I think you forgot the final ":"? It should be "3 f 0 :", right?
Posted: 19.07.2003, 02:24
by don
Oops, you typed "Sun" instead of "Sol" (smile).
Your code example works fine when this change is made.
Thank you!
Posted: 19.07.2003, 03:50
by don
One more question re: lock ...
Would anyone ever want to lock on a single object? If so, for what purpose?
Thanks!
-Don
Posted: 19.07.2003, 04:02
by chris
There's no point . . . If you try and do this, Celestia will force the target body to be the parent star of reference object.
--Chris
Posted: 20.07.2003, 22:01
by don
I agree with "no point".
However, at times, I see the Celestia display show something like "Lock Earth - ", so something is letting it "lock" to a single object, or letting this slip by, or UNlocking the second object for some reason, without also UNlocking the first. Maybe this is desirable?
That's why I asked <smile>.
-Don