Added code that allows script to display images as overlayed

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
ben_o
Posts: 19
Joined: 02.09.2004
With us: 20 years 2 months

Added code that allows script to display images as overlayed

Post #1by ben_o » 08.09.2004, 10:48

I have added code that allows a script to load images by filename and display them on screen at a scripted size, position and alpha.
i.e.

Code: Select all

showimage { image "test.png"
                    left 100.0
                    bottom 100.0
                    xSize 300.0
                    ySize 300.0
                    alpha 0.8 }


I haven't yet added the script to remove them however, as the problem lies in whether to first add script that removes them all, or script that selectively removes them, one by one, or even have a time limit on the images... :(

I would upload a screenshot, but I have no webspace accessible from work.

If anyone is interested in this, let me know.

Ben
Fortune:
Cropp's Law: The amount of work done varies inversely with the time spent in the office.

krezip
Posts: 2
Joined: 11.06.2005
With us: 19 years 5 months

Post #2by krezip » 11.06.2005, 01:50

so, it could be one of the most useful feature

can you send me this addon?

krezip@freemail.hu

thx
ADam

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #3by BlindedByTheLight » 12.06.2005, 21:46

Ben... what would be a circumstance where this would be used?

Thanks
Steven Binder, Mac OS X 10.4.10

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

Post #4by selden » 12.06.2005, 22:17

I'm not Ben, but I can think of at least two:

1. informational overlays, perhaps showing data about the object(s) in view, so text messages don't have to be coded in a script.

2. pictorial overlays, that could, for example, give one the impression that one is looking out
the window of a spacecraft.
Selden

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #5by maxim » 13.06.2005, 11:13

There would be a lots of possibilities using overlay images.

Beside beeing able to widely mask the onscreen appearance of Celestia, you also could display images of the real thing where Celestia only offers a more schematic view. Or you can display schematics and diagrams to explain facts that can't be seen in celestia (solar wind, magnetosphere, roche limit, kuiber belt, lines, points, arrows and a lot more). You could display help screens like actual keybord layout, or explanations to your running script, own splash screens and so on.

I'm sure you can find many more examples for yourself. :wink:

maxim

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #6by BlindedByTheLight » 18.06.2005, 07:58

Ben... when you say "code" do you mean C++ code or script code? I know that's probably a really dumb question... but I'm learning... :)
Steven Binder, Mac OS X 10.4.10

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #7by ElChristou » 18.06.2005, 11:43

Hello,

This can be interesting... Do exist a patch?
Image

ben_o_
Posts: 9
Joined: 09.07.2005
With us: 19 years 4 months
Location: Oxford, UK

Post #8by ben_o_ » 09.07.2005, 09:29

Thanks for the comments. As you can see, I felt that my first post disappeared into the ether last year and have stopped all work.

Out of curiousity, I checked the boards and have seen that there is a 'glut' of June posts from *this year* about the patch!

I did submit this to the developers email-list, but had an email snafu and heard no more about it (my fault) and have moved on to a different email address now. (Hence ben_o_ with the _ on the end.)

What my changes did

* Laymans terms *
Put your image in the 'lowres' dir and addshowimage { image "test.png"
left 100.0
bottom 100.0
xSize 300.0
ySize 300.0
alpha 0.8 }

Images can be taken off screen using a dropImage cel command (First image on, last image off)

*End layman*
* C++ info *
Where I got to was simply that you could load up a image from the texture dir (using pre-existing img loading functions), put it on a GL_QUAD, and this was contained in a Vector class container. Why Vector? At the time, I was more interested into adding my own stage into the render/cel pipeline...

Used pop and pull to add/remove images from the pipeline.

*end c++*

Your comments have sparked me into trying to add the same functionality into the new codebase (Mine worked on 1.33-4 I think)

PS I had also considered adding in a 'educational mode' whereby you could tick a box on a gui/set it on the command line, and when you clicked on, say Mars, it would look for Mars.cel and run that. Mar.cel would have a preset interactive 'lecture', using images from NASA, showing the 'face' of Mars, under low and high res imaging, etc. That's my real first aim.

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #9by fsgregs » 12.07.2005, 15:06

Dear ben_o:

I write a lot of educational activities for Celestia. The ability to overlay a graphic onto the screen (spacecraft window, grid, arrows, diagrams, etc.) by some keystroke command, and take the graphic off again while the program is still running, is a great feature. I could use it dozens of ways.

Please finalize this code and tell us how to get it. By the way, Celestia version 1.4.0 is the new version and although still in pre-release, Chris is planning to release the next pre-release soon (1.4.0pre 7). Look for an announcement on the forum soon. Please use it as your base application and apply your code changes to it.

Looking forward to more details.

Frank G

ben_o_
Posts: 9
Joined: 09.07.2005
With us: 19 years 4 months
Location: Oxford, UK

Post #10by ben_o_ » 12.07.2005, 15:38

I am mid way through setting up my home server, as I have rapidly become dissatisfied with the costs involved in renting space on a php/mysql server for my own personal use.

I will add a page up there soon with the patch for the old version + instructions (I'll add a new thread to this forum when I'm done.)

I have some holiday time coming up next week so I should be able to do some work on it then. The server should be setup by this Friday, but may only have an IP address, as opposed to being http://www.maysubdivide.org (which is also my current static, useless, non-dynamic site which I have now emptied.)

Ben

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #11by fsgregs » 07.08.2005, 03:41

Ben:

Any update on your effort to add the overlay feature that the thread discusses? I'm anxious to put it to use.

Frank

ben_o_
Posts: 9
Joined: 09.07.2005
With us: 19 years 4 months
Location: Oxford, UK

Post #12by ben_o_ » 07.08.2005, 09:47

Just updating it to the new version in CVS. (Had a weird build problem, but that's okay, as I now know it's not my fault!)

Ben

ben_o_
Posts: 9
Joined: 09.07.2005
With us: 19 years 4 months
Location: Oxford, UK

Post #13by ben_o_ » 08.08.2005, 02:39

Patch can be obtained from here:

http://82.69.120.120/blog/?postid=18

Ben


Return to “Development”