Controlling Celestia from an external application like Flash

General discussion about Celestia that doesn't fit into other forums.
Topic author
howard
Posts: 18
Joined: 04.06.2004
With us: 20 years 5 months
Location: Colorado Springs/Denver

Controlling Celestia from an external application like Flash

Post #1by howard » 04.11.2004, 19:28

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.

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 11 months
Location: N?rnberg, Germany

Post #2by maxim » 04.11.2004, 20:24

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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #3by selden » 04.11.2004, 20:28

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.
Selden

Topic author
howard
Posts: 18
Joined: 04.06.2004
With us: 20 years 5 months
Location: Colorado Springs/Denver

Post #4by howard » 04.11.2004, 21:25

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.

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 11 months
Location: N?rnberg, Germany

Post #5by maxim » 05.11.2004, 13:10

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

Topic author
howard
Posts: 18
Joined: 04.06.2004
With us: 20 years 5 months
Location: Colorado Springs/Denver

Post #6by howard » 05.11.2004, 14:32

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!

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 11 months
Location: N?rnberg, Germany

Post #7by maxim » 05.11.2004, 15:25

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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #8by selden » 05.11.2004, 16:14

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.)
Selden

HankR

Post #9by HankR » 05.11.2004, 17:00

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

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 11 months
Location: N?rnberg, Germany

Post #10by maxim » 06.11.2004, 14:36

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 :)

Topic author
howard
Posts: 18
Joined: 04.06.2004
With us: 20 years 5 months
Location: Colorado Springs/Denver

Post #11by howard » 09.11.2004, 19:27

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!

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #12by hank » 10.11.2004, 21:05

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

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #13by Rassilon » 10.11.2004, 21:54

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...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

thekryptonian
Posts: 5
Joined: 31.10.2004
With us: 20 years
Location: Simi Valley

Remotely controlling Celestia via Flash

Post #14by thekryptonian » 14.12.2004, 21:41

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.


Return to “Celestia Users”