Page 1 of 1

Controlling Celestia from an external application like Flash

Posted: 04.11.2004, 19:28
by howard
Has anyone tried, or does anyone know of someone who has tried to control Celestia from an external application like Flash or Anark Studio or even from a browser?

Embeding Celestia inside of some sort of external UI would open up some interesting possibilities for rich media applications.

Posted: 04.11.2004, 20:24
by maxim
I tried to do a small contribution with my prototypic 'Info Extension Plugin' or the 'Pulsar Sounds Tour'. You may take a look on my page.

maxim

Posted: 04.11.2004, 20:28
by selden
If your control program can send command lines to the operating system, then "it just works," although relatively slowly.

You, or your program, can invoke Celestia by typing the command line

celestia --once --url filename.cel

"--once " (two hyphens) sends the command to the running copy of Celestia, if there is one, else it starts a new copy.

"--url " (again, two hyphens) must be followed either by a Cel:// URL or by the name of a file containing a .CEL or .CELX (Lua) script.

The script could be a oneliner written by your control program, or as complicated as is appropriate.

Posted: 04.11.2004, 21:25
by howard
Thanks guys. Maxim I have your stuff and will have a look.

How about envoking mouse/keyboard events to control/navigate Celestia from Flash (I'll use that app as the running example) to say, use a .cel to get to the ISS upon launch of Celestia but then be able to manipulte the station from there.

Idea is to use Flash to build a UI, for example, an orbiter cockpit and be able to provide the user the experience of flying up to and arround the station at will. The UI is flash and Celestia is the application you see through the window.

Posted: 05.11.2004, 13:10
by maxim
If you are working on windows and don't want to go into real programing, the only solution I can see is to get a helper application that hooks into the event handling queue for whatever program you like to use as UI, and translates and targets some of these events to the running celestia window.

There should be some of this stuff out there, even as freeware. You might take a look at 'girder' a very powerfull tool for remote controlling applications or even your complete computer. Probably this one is too mighty and complex for your special task, but I'm sure you'll find simpler ones.

If you manage to get along, I'd like to hear-from/see the results of your efforts.

maxim

Posted: 05.11.2004, 14:32
by howard
I'm guessing you have no clues for the MAC side of the fence. Right now I am ristricted to that.

I am actually using a product called Anark Studio http://www.anark.com , which is basically a platform for putting together rich media using 3D. If you haven't seen it you should. Anyway there are ways in that software to "jump" to external content but I have yet to figure it out.

When I get this working I will post a web loction for all to see.

In the meantime I'll take any input the community has to offer!

Posted: 05.11.2004, 15:25
by maxim
howard wrote:I'm guessing you have no clues for the MAC side of the fence. Right now I am ristricted to that.

No, sorry. I'm almost completely unaware of MAC interior. I'm even more familar with VAX/VMS than Apple stuff ;)

maxim

Posted: 05.11.2004, 16:14
by selden
maxim,

You're showing your age ;)

That's OpenVMS VAX, not to be confused with
OpenVMS Alpha and OpenVMS I64 (also known as OpenVMS Integrity)
:)

(And I'm in the same situation: someone else here does our Mac support.)

Posted: 05.11.2004, 17:00
by HankR
Howard,

In the forthcoming version of Celestia 1.3.2 for MacOS X you will be able to use the MacOS X "open" command to cause Celestia to run a specified script file.

- Hank

Posted: 06.11.2004, 14:36
by maxim
selden,

I'm not sooo old. ;) But you're right - it's OpenVMS now.
And even more: there is Apache, MySQL and Firefox available for OpenVMS.
Wonder if I can get a cheap old microvax somewhere - for building up a secure and stable litte webserver.

maxim :)

Posted: 09.11.2004, 19:27
by howard
Hank,

When will you release 1.3.2 for OS X?

BTW, thanks for all the work getting Celestia up and running on the superior platform, MAC!

Posted: 10.11.2004, 21:05
by hank
howard wrote:Hank,

When will you release 1.3.2 for OS X?


There's an initial version of 1.3.2 available at Sourceforge now. It doesn't include the "open" feature mentioned above, however. I've been distracted by looking at version 1.4 (prerelease), which is very cool, but I'll try to get back to work on another release for 1.3.2 shortly. In addition to adding Lua scripting I've reworked the preferences code so it saves more settings between sessions, and I want to do a bit more testing before it goes out. Also, I don't think I want to make too many incremental releases via Sourceforge.

- Hank

Posted: 10.11.2004, 21:54
by Rassilon
In flash it would be pretty simple, just create a button and attach an action to it

Code: Select all

on(release) {
getURL("cel url here");
}


The individual browsing the website would of course have to have the same setup/addons as you do of course to see what your trying to portray...

howard wrote:Thanks guys. Maxim I have your stuff and will have a look.

How about envoking mouse/keyboard events to control/navigate Celestia from Flash (I'll use that app as the running example) to say, use a .cel to get to the ISS upon launch of Celestia but then be able to manipulte the station from there.

Idea is to use Flash to build a UI, for example, an orbiter cockpit and be able to provide the user the experience of flying up to and arround the station at will. The UI is flash and Celestia is the application you see through the window.


Hmm that one is a bit tough and from what little Ive poked around with Celestia's scripting system I dont think you could do this...Any sort of input into celestia like this would have to be done using Lua...I suppose you could try having flash generate simple lua scripts on the fly and have them execute then but Flash no longer allows the external operation of files since version 6.0 due to security reasons...Java might be a better option for something like this...I suppose some in depth Java beans could probably load Celestia via a Lua script and control its movement...As for a cockpit...Thats only if Chris or Harald implemented a feature like this in some more recent version of the celx system...using a script to load a 3ds or cmod file of a cockpit and have it follow the observer...

Remotely controlling Celestia via Flash

Posted: 14.12.2004, 21:41
by thekryptonian
howard wrote:Thanks guys. Maxim I have your stuff and will have a look.

How about envoking mouse/keyboard events to control/navigate Celestia from Flash (I'll use that app as the running example) to say, use a .cel to get to the ISS upon launch of Celestia but then be able to manipulte the station from there.

Idea is to use Flash to build a UI, for example, an orbiter cockpit and be able to provide the user the experience of flying up to and arround the station at will. The UI is flash and Celestia is the application you see through the window.

Hmm that one is a bit tough and from what little Ive poked around with Celestia's scripting system I dont think you could do this...Any sort of input into celestia like this would have to be done using Lua...I suppose you could try having flash generate simple lua scripts on the fly and have them execute then but Flash no longer allows the external operation of files since version 6.0 due to security reasons...Java might be a better option for something like this...I suppose some in depth Java beans could probably load Celestia via a Lua script and control its movement...As for a cockpit...Thats only if Chris or Harald implemented a feature like this in some more recent version of the celx system...using a script to load a 3ds or cmod file of a cockpit and have it follow the observer...[/quote]

Here's an idea - Flash can't talk to your operating system directly, but it can open a pipe to a servlet and perform XML transactions with the servlet. If you built in a communications handler into Celestia, you could send control codes from your Flash interface and control Celestia as though you were entering keystroke, mouse or joystick commands directly. If you ran that over the Internet, the control lag could be considerable. If Celestia and its Flash-based controller program were both on the same subnet in a LAN, though, that would be another matter. It could be quite responsive if the XML command size were kept small.