I'm thinking about adding a "lander" to my CelestiaExplorer script. What this means is that you would be able to "exit" your virtual spacecraft. On the screen would be a lander display with appropriate controls for landing. But of course you should be able to see the spacecraft you were undocking the lander from.
My question is ... is it possible to display a model in a specific location dynamically? And if so, how would this be accomplished?
Thanks!
Henry
Can you display a model in Celestia dynamically?
In principle one could create a Lua script for v1.5.0 that would move models around. I don't think anybody has tried to do it yet.
Depending on the kind of motion, one could also use a script that would change the model's orientation: rotating an appropriately designed model could make the spacecraft seem to travel along an arc.
Depending on the kind of motion, one could also use a script that would change the model's orientation: rotating an appropriately designed model could make the spacecraft seem to travel along an arc.
Selden
Chris provided an example in the thread Pointing Hubble although it doesn't seem to point in quite the right direction.
Selden
Not really.
There are quite a few bits and pieces here and there, but nothing that clearly describes how to implement a ScriptedOrbit or a ScriptedRotation from the beginning. (They don't work at all for me: Celestia spews error messages at an unreadable rate, one for each frame it draws.)
Vincent puzzled out how to do some of it for the Lua Edu package, but that's both overkill for this and doesn't implement the ScriptedRotation any more. Maybe he can help, though. See the thread Lua Edu Tools : content and layout...
There are quite a few bits and pieces here and there, but nothing that clearly describes how to implement a ScriptedOrbit or a ScriptedRotation from the beginning. (They don't work at all for me: Celestia spews error messages at an unreadable rate, one for each frame it draws.)
Vincent puzzled out how to do some of it for the Lua Edu package, but that's both overkill for this and doesn't implement the ScriptedRotation any more. Maybe he can help, though. See the thread Lua Edu Tools : content and layout...
Selden
-
Topic authorhharris
- Posts: 79
- Joined: 23.02.2006
- With us: 18 years 9 months
- Location: Pasadena, CA 91104
Selden,
I've reread the "pointing hubble" thread you recommended and found I'd missed the salient point. To point hubble you have to exit Celestia, go to the ssc text file, edit its parameters, and then reload Celestia.
Here's my real question (although I think I already know the answer):
Are the data structures, created when an scc file is read in, available during program execution? Certainly this must be possible in principle.
If not, I'd like to lobby for that capability be added in the future, if possible. It would open up a lot of possiblities. I also realize there might be an efficiency problem here since compilation may wrap everthing up in a form that is difficult or even impossible to modify.
Henry
I've reread the "pointing hubble" thread you recommended and found I'd missed the salient point. To point hubble you have to exit Celestia, go to the ssc text file, edit its parameters, and then reload Celestia.
Here's my real question (although I think I already know the answer):
Are the data structures, created when an scc file is read in, available during program execution? Certainly this must be possible in principle.
If not, I'd like to lobby for that capability be added in the future, if possible. It would open up a lot of possiblities. I also realize there might be an efficiency problem here since compilation may wrap everthing up in a form that is difficult or even impossible to modify.
Henry
In principle, the orientation of a body (e.g. a telescope or spacecraft) can be controlled in realtime by a Lua routine. Despite Chris' example code, I have not yet been able to get it to work.
As best I can tell, and I could be mistaken (I have not yet looked at the C++ code), one of many problems for the novice is that the angles used by Celestia to update an object's orientation while redrawing the screen are stored as quaternions, not as polar coordinates similar to RA and Dec.
As best I can tell, and I could be mistaken (I have not yet looked at the C++ code), one of many problems for the novice is that the angles used by Celestia to update an object's orientation while redrawing the screen are stored as quaternions, not as polar coordinates similar to RA and Dec.
Selden
-
Topic authorhharris
- Posts: 79
- Joined: 23.02.2006
- With us: 18 years 9 months
- Location: Pasadena, CA 91104
Well, of course, what the Celestia documentation refers to as "rotations" are in fact quaternions. But as far as I know, all the operations that are defined for quaternions are about setting the orientation of the observer, not the orientation of a model. I have no problem with using quaternions. They are, mathmatically speaking, a very well-behaved way of describing and modifying 3D rotations.
Henry
Henry
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
hharris wrote:I've reread the "pointing hubble" thread you recommended and found I'd missed the salient point. To point hubble you have to exit Celestia, go to the ssc text file, edit its parameters, and then reload Celestia.
Henry,
I've modified Selden's "Pointing Hubble" addon to make Hubble point at the current selection, i.e., to make Hubble's orientation change everytime a new object is selected (of course, without restarting Celestia). To do that, I've used the scriptedRotation definition and the Lua script that Chris provided in the "Pointing Hubble" thread. I've even nearly managed to give users the possibility to rotate Hubble arounds its 3 axis using some "Rot X", "Rot Y", "Rot Z" active buttons.
However, as evocated by Selden, there seems to be a bug whether in the script or in the Celestia code itself. That's why I've given up trying to finalize this addon.
There's good news, though : Chris ensured me via PM that he is currently investigating the problem...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Isn't it possible to actually put observer in the spaceship, so he would see things through some kind of window, and then actually move observer out of the ship
Is is possible now to view space through the window of your spaceship, then use a cel:url or a bookmark to move your view outside of the ship, looking toward it. Once outside, you can move around the ship any way you wish. As an example, here is a screenshot of your Celestia spaceship, looking at it through the ship's window:
The ship model is called the Celestia 1, and is on the motherlode. The cockpit is a custom add-on that is part of the educational activity series. However, two other forum members (Boux and Andrea), just reworked the cockpit to make it more dynamic. See this thread:
http://celestiaproject.net/forum/viewtopic.php ... c&start=15
Hope this helps
Frank