Page 1 of 1

Experimental code for overlaying images - Who's?

Posted: 02.09.2004, 15:49
by ben_o
This looks like the starting point for something I was going to add myself. I was thinking of adding a .cel script commands like

Code: Select all

showImage "MarsSurface.jpg", 10,10
to load and display an image on a quad at the required screen coords. (Also commands to remove it again, obviously)

Just wondered if I was stepping on anyones code if I continued and tried to implement my idea. ( I want to avoid two versions of very similar code made by two people)

Also does anyone think that this would be a useful feature? I want to use urls for image locations, eventually.
I think that iit might be useful for small scripts to see the latest Cassini/whatever images, educational tours with diagrams/surface shots/actual photos/ explanations.

Thanks

Ben

Posted: 02.09.2004, 15:51
by ben_o
The code I was talking about is at lines 3,281-3,311 of celestia/celestiacore.cpp :oops:

Not my day... Sorry

Posted: 02.09.2004, 16:29
by ben_o
The cel command I am thinking of implementing is:

Code: Select all

showImage { image marsSurface.jpg
            left 10
            top 10
            right 40
            bottom 40
            alpha 80 }


The thing is, it seems that celx/Lua is becoming the development direction for the scripting, and I get the feeling that .cel format is going to be depreciated at some point soon.

Anyone have any opinions?

Posted: 02.09.2004, 21:18
by Harry
ben_o wrote:The thing is, it seems that celx/Lua is becoming the development direction for the scripting, and I get the feeling that .cel format is going to be depreciated at some point soon.

I don't expect the CEL-code to be deprecated or removed anytime soon - as long as it still works without significant changes with the Celestia-core it probably will stay around. But CELX is much more powerful and has seen significant development in recent versions, so it would be strange to see a new feature added exclusively to CEL-scripting.

Anyway, it would be nice to have some idea of what scripting-features a future version of Celestia should provide. There have been ideas about manipulating and adding objects from scripts for quite some time, but generally the problem is that it's easy to add or modify an object, but hard to remove it again. This may not be a problem for simple images, because you can better control what code is accessing the data.

If I understand you correctly you want to retrieve the images from a webserver... this would require adding networking and HTTP-handling code into Celestia.

Harald

Posted: 02.09.2004, 21:26
by selden
Also, don't forget that most pictures on the Web are unusable by Celestia because they don't have dimensions that are a power of two.

In other words, it probably would be more appropriate to have an external program download and translate the image before making it available in Celestia. This all could be scripted, of course.

Posted: 03.09.2004, 08:29
by ben_o
The code that interprete cel scripts seem fairly staightforward to add to. Add a hook to celengine/cmdparser.cpp to understand the code, and a command in celengine/command.cpp to implement. (The vector<OverlayImage> I would need is already somewhat implemented in celestia/celestiacore.cpp)

I haven't been looking at how Lua interfaces with celestia though. What's the best place to get a heads up on .celx and how it works inside celestia?

Ben

(Oh, and about using url's for images... just an offshoot from a far flung idea I had to use a bittorrent style service to 'stream' high quality VT's as and when people needed them. Bittorrent to lower the demand on the server, and also to lower the initial download payload of Celestia. Probably never be implemented, but what the hey.)

Posted: 03.09.2004, 10:47
by Harry
ben_o wrote:The code that interprete cel scripts seem fairly staightforward to add to. Add a hook to celengine/cmdparser.cpp to understand the code, and a command in celengine/command.cpp to implement. (The vector<OverlayImage> I would need is already somewhat implemented in celestia/celestiacore.cpp)
Well, modifying celx.cpp isn't much harder once you got the general picture of how the Lua<->C++ interface works.

I haven't been looking at how Lua interfaces with celestia though. What's the best place to get a heads up on .celx and how it works inside celestia?
It's all in src/celestia/celx.cpp, which has become quite a monster with over 4500 lines of code. Most of it is just Lua/C++-interface code, nothing complicated. I can answer your questions, maybe open a new thread in the scripting forum?
(Oh, and about using url's for images... just an offshoot from a far flung idea I had to use a bittorrent style service to 'stream' high quality VT's as and when people needed them. Bittorrent to lower the demand on the server, and also to lower the initial download payload of Celestia. Probably never be implemented, but what the hey.)

Well, even my HD has problems to keep up with texture-loading, I can't imagine pulling them over the network would really be anywhere fast enough (bandwidth and latency-wise). :(

Harald