Celestia v1.5 provides support for ScriptedOrbit and ScriptedRotation functions. Since these functions run in a separate context, they do not (yet?) have access to the keyboard or joystick. However, these functions can determine what object is currently selected.
If one defines appropriate DSC objects, one can use them to communicate with ScriptedOrbits and thus cause the object controlled by that script to move arbitrarily.
A very simple and crude example of such control is available in
http://www.lepp.cornell.edu/~seb/celest ... ontrol.zip
It's about 1MB since I left in the files used to develop the rather simple spacecraft model that it uses.
Here's an example of a split-screen control:
The upper pane is the object being controlled, positioned above the reference object located where it started.
The lower half shows the three DSC objects one selects to move it: Fwd, Stop & Rev. One can also watch the object in a full-screen window and select the objects by typing their names.
Expanding on this to provide full 3D control of an object is left as an exercise for the student.
Interactive positioning of SSC objects.
-
Topic authorselden
- Developer
- Posts: 10192
- Joined: 04.09.2002
- With us: 22 years 2 months
- Location: NY, USA
Interactive positioning of SSC objects.
Last edited by selden on 02.07.2007, 22:03, edited 1 time in total.
Selden
Re: manual positioning of SSC objects.
selden wrote:Celestia v1.5 provides support for ScriptedOrbit and ScriptedRotation functions. Since these functions run in a separate context, they do not (yet?) have access to the keyboard or joystick. However, these functions can determine what object is currently selected.
...
One can also watch the object in a full-screen window and select the objects by typing their names.
I suppose one could also write a user script with keyboard input that responds to a particular key press by selecting one of the DSC control objects.
- Hank
-
Topic authorselden
- Developer
- Posts: 10192
- Joined: 04.09.2002
- With us: 22 years 2 months
- Location: NY, USA
Hank,
Yup, you're right!
Related comment:
For some reason, my attempts to directly compare selected objects with "found" objects always returned a false. I wound up having to test the distance between the selected object and the control objects. Maybe I was just doing something wrong. In particular, I couldn't seem to get something like this to work:
It always seemed to take the "else" branch.
Yup, you're right!
Related comment:
For some reason, my attempts to directly compare selected objects with "found" objects always returned a false. I wound up having to test the distance between the selected object and the control objects. Maybe I was just doing something wrong. In particular, I couldn't seem to get something like this to work:
Code: Select all
Vel = function ()
local c1 = celestia:find("Fwd")
local c2 = celestia:find("Stop")
local c3 = celestia:find("Rev")
local s1 = celestia:getselection()
if (s1 == c2) then return 0
elseif (s1 == c1) then return 1e4
elseif (s1 == c3) then return -1e4
else return vP
end
end
It always seemed to take the "else" branch.
Selden
selden wrote:For some reason, my attempts to directly compare selected objects with "found" objects always returned a false. I wound up having to test the distance between the selected object and the control objects.
My guess would be that the celx functions are returning copies, so the identity test fails. But why not just check the name of the current selection?
- Hank
So... once this is fully into Celestia, I could in theory (and with some time for development for models, and the innards of Celestia orbits and rotations and such) ...
... Load up ElChristou's Atlantis... open the bay doors, close them, perform RCS burns, and even rotate to dock with ISS? All from typed in keyboard commands?
I will NEVER leave the house again.
... Load up ElChristou's Atlantis... open the bay doors, close them, perform RCS burns, and even rotate to dock with ISS? All from typed in keyboard commands?
I will NEVER leave the house again.