Interactive instruction & Information In Image (i3i) Ove

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
Topic author
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Interactive instruction & Information In Image (i3i) Ove

Post #1by Joe » 17.06.2006, 21:14

On top of Vincent's Celestia-1.4.1-Patch3, I created a new feature of interactive overlay image. For the time being, it is only in Win32 version. You can download the compiled pack and the modified source at:
http://www.provr.fsnet.co.uk/i3i.rar

1. ABOUT I3I FEATURE
=====================
It enables Celestia to load an overlay image (bmp, Jpg, png, the size of the image must be in 2's power) and use the hot sensor areas/buttons in the image to control and interact with Celestia.

For the time being, I have only built a Win32 version. Sorry for non-Win32 users, you need to build your own GUI.

2. INSTALLATION
=====================
(1) You must put celestia_1.4.1_patch_i3i.exe in the same folder where the normal celestia.exe is installed.
(2) I have provided for you a test file called keyboard.i3i. It is an editable text file and it associates with an image file called keyboard.png (this image can also be a *.bmp, *.jpg file of different name). Key this keyboard.i3i file and its associating image file in the SAME folder. I kept them within file folder I3I_TEST. You can put I3I_TEST folder in any directory.
(3) The I3I_TEST folder contains following files:
(a) celestia_1.4.1_patch_i3i_readme.txt
This current readme file
(b) default.bmp
Used by i3i_designer.exe as default image to load
(c) default.jpg
Used by i3i_designer.exe as default image to load
(d) default.png
Used by i3i_designer.exe as default image to load
(e) i3i_designer.exe
Image benchmarking programme
(f) I3I_designer.i3d
Native data file of image benchmarking programme
(g) keyboard.i3i
Generated, by the image benchmarking programme, editable i3i file for Celestia to load
(h) keyboard.png
Saved, by the image benchmarking programme, the overlay image file assocaited with the i3i file.

3. HOW TO RUN IT
=====================
--Activate celestia_1.4.1_patch_i3i.exe
--Select File menu
--Choose Load I3I... option
--From i3i_test folder, open keyboard.i3i file
--You will see a keyboard overlay appears in Celestia's window. Move your mouse cursor over the buttons H, J, K, L, an i3i hand-cursor appears
--Click H, J, K, or L button to interact with Celestia
--Press F9 key (in your key board) to toggle the overlay image.

I have provided only a few sensor buttons in the image. You can add more sensors by editing the keyboard.i3i file via a text editor. Because you must know the location of the sensor areas in relation to the image size, editing of keyboard.i3i file can be very laborious. I have built a very crude image benchmarking programme for you to generate the *.i3i file.

4. IMAGE BENCHMARKING
=====================
--Activate image benchmarking programme i3i_designer.exe, scrolling down the I3I_Designer window to see the default image (which is a rough keyboard image)
--You can use File->Import I3I Image option to load an bmp, jpg or png image if you do not want the default image. Remember to make sure that the image size must be kept in 2's power.
--Use View->Grid Lines or press g key in your keyboard to toggle the grid lines on and off.
--Use Rectangle drawing tool to draw a rectangle sensor area (e.g. around a button in the loaded image)
--Double click the rectangle just drawed to assign it the i3i properties:i3i SensorName and i3i SensorAction. Since the i3i SensorName is optional, you can leave it in the default name (Text). But for i3i SensorAction, you have to give it the correct command text if you want Celestia to be controlled by clicking the sensor area. For the keyboard image, if you have drawed a rectangle around button F, then you need to assign a letter F in the i3i SensorAction box. This will make this rectangle a sensor area to control switch Celestia in Follow mode.
Note: DO NOT OVERLAP ONE SENSOR AREA ON OTHERS
--Use File->Import I3I Image option to generate automatically the *.i3i file
--Use File->Save (or Save as) to save your benchmarking data (*.i3d) for later benchmarking session, so that your work in the current session will not be lost.

5. SOURCE CODE
=====================
I added the i3i feature on top of Vincent's celestia_1.4.1_patch3 version. However this feature does not rely on any modified code made by Vincent. You can build the i3i feature on top of the official Celestia source code by following changes:

(1) Modify the source code in following files. Search the word Zhao for the modified code blocks:
-- celestiacore.cpp
-- celestiacore.h
-- winmain.cpp
-- resource.h
-- celestia.rc

(2) Add following files to the new \src\celi3i folder:
-- celi3i.dsp
-- celi3i.vcproj
-- fileloading.cpp
-- fileloading.h
-- i3i.mak
-- sensori3i.cpp
-- sensori3i.h

(3) Add following i3i hand-pointer cursor file to the \src\celestia\res folder:
-- pointerhand.cur

6. SOURCE BUILD
=====================
You need first to get Vincent's celestia_1.4.1_patch3 source code. Then download my modified code in folder celestia-1.4.1. Copy everything from my celestia-1.4.1 folder to Vincent's celestia-1.4.1 folder.

Then you can compile the source either via Celestia.sln or using makerelease.bat file.

For non-Win32 users, you have to build your own GUI and do your own compilation files.
Joe
8O

Avatar
Topic author
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Post #2by Joe » 23.06.2006, 13:04

No comments from and interested forum member(s)? Okey I got the message --it is a wrong type of work on which I have spent my last weekends, time to put the brake on it now.
Joe

8O

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #3by buggs_moran » 23.06.2006, 13:38

Don't take it personally Joe. I dont necessarily have a use for it, but someone may. For instance, kiosk use where there is no available keyboard. You might have posted your intentions in development before spending your weekends. One thing is that there are quite a few OSX and Linux users who might have seen this post and said oh well and moved on. Like I said, someone may be able to use it. They just haven't thought about it much.
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #4by t00fri » 23.06.2006, 13:47

Before embarking into concrete coding activity, it is always a good idea to be /informed/ about the current CVS state of the art and the current dev activities. That was also to some extent a problem with Vincent's earlier patches.

Find below two recent additions to CVS by Chris which should be exploited. If people start with uncoordinated code experiments, it is not too surprising if the resonance from the devs remains low.

Chris wrote:I made two checkins recently for which I owe an explanation. One of them certainly merits some discussion on this list.

I enabled overlay textures in the OpenGL 2.0 render path. Since more and more people are using this render path, it's important that overlay textures are available for limit of knowledge surfaces and add-ons. In the OpenGL 2.0 path, the overlay texture is blended in the shader rahter than in separate render pass. This is both more flexible (it works on translucent objects) and faster (the geometry is only processed once, no read/modify/write to the framebuffer when blending the second pass) than the two pass approached used in the other render paths.

The second checkin was a partial implementation of event handlers for celx scripting. I will be committing the second (smaller) part of the change tonight. There are two new commands for scripting: registereventhandler and geteventhandler. At the moment, I'm only supporting keyboard events, but there's nothing stopping us from using the same commands for different event types. Registereventhandler takes two arguments: a string with the event name and a Lua function, which may be nil. Geteventhandler returns the Lua function associated with an event (or nil, if an event handler hasn't been registered.)

A sample start.celx script could contain this code to bind the capital G to a 'slow goto' function.

function slowgoto
o = celestia:getselection()
obs = celestia:getactiveobserver()
obs:goto(o, 20)
end

registereventhandler("G", slowgoto)

...


The new scheme is very flexible and quite elegant in many respects.

Bye Fridger
Image

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #5by Vincent » 23.06.2006, 17:51

t00fri wrote:Before embarking into concrete coding activity, it is always a good idea to be /informed/ about the current CVS state of the art and the current dev activities. That was also to some extent a problem with Vincent's earlier patches.

Fridger,

I think we agree that it was a problem only for users who were expecting these patches to be included in the official release... :wink:

As for the partial implementation of event handlers for celx scripting, it is really good news ! For script users, of course... :wink:
@+
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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #6by t00fri » 23.06.2006, 18:05

Vincent wrote:Fridger,

I think we agree that it was a problem only for users who were expecting these patches to be included in the official release... :wink:
...


Vincent,

certainly. Still, after all the useful coding work you did, it would have been way better if it had the "scope" to fit right into the official distribution.

I am just sorry to also see Joe invest all this work.

Celestia is a complex code structure and meanwhile needs professional style coordination as to new code implementation.

Bye Fridger
Image

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #7by Vincent » 23.06.2006, 18:41

t00fri wrote:Still, after all the useful coding work you did, it would have been way better if it had the "scope" to fit right into the official distribution.


Of course Fridger.
But since I only discovered Celestia's code, and more generaly C++ coding, 5 months ago, my only aim was to build some stable features that fit my needs, and the educators community's needs by the same occasion. But if I had the skill, and if the official devs would have been interested in some of the features, I wouldn't have hesitated to spend some more time making the patches more elegant so that they would have fit into the official distribution.
Last edited by Vincent on 24.06.2006, 07:41, edited 2 times in total.
@+
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
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #8by Vincent » 23.06.2006, 18:52

Joe wrote:No comments from and interested forum member(s)? Okey I got the message --it is a wrong type of work on which I have spent my last weekends, time to put the brake on it now.


Joe, I am very busy at the moment, and I don't come to the forum as often as I did a few weeks ago...

But I will try your patch as soon as possible, and will let you know my impression about it.
@+
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

Avatar
Topic author
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Post #9by Joe » 24.06.2006, 15:34

I am just sorry to also see Joe invest all this work.

Fridger,
Thanks for the comments. Truly my work was to show some ideas which I hoped they could be inspiring to the forum. Whether or not it will be taken into accounts by the official release has not been in my initial thoughts, only wondering the feature be considered useful or not by some trying work to share with the members, so I posted in this thread :D .
Joe

8O

Avatar
Topic author
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Post #10by Joe » 24.06.2006, 15:37

But I will try your patch as soon as possible, and will let you know my impression about it.

Vincent,

Please do and hope part of it could be merged into your efforts :lol:
Joe

8O

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #11by Vincent » 25.06.2006, 15:43

Joe,

I've quickly tested your patch. And I personaly find your interactive overlay image feature very interesting.

For example, it could be used in association with the InfoImage/InfoText function to switch between the different images/rawTexts available for a specific object (= DIAPORAMA :D !).

Then, there are some points that should be improved for a more stable/comfortable use :
1- The overlay image should be automatically resized according to the screen dimensions (800*600, 1024*768, 1280*1024...).
2- In the .i3i files, I noticed that each sensitive area is associated to a specific key. So every new feature should be associated first to a specific key.... But the problem is that no more control key is available...

I'm sorry not to be able to test your patch further but I am very busy at the moment (job + music realization)...

Good luck, and keep on the good work ! :wink:
@+
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

Avatar
Topic author
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Post #12by Joe » 05.07.2006, 13:08

Vincent wrote:Then, there are some points that should be improved for a more stable/comfortable use :
1- The overlay image should be automatically resized according to the screen dimensions (800*600, 1024*768, 1280*1024...).
2- In the .i3i files, I noticed that each sensitive area is associated to a specific key. So every new feature should be associated first to a specific key.... But the problem is that no more control key is available...


Thanks for the comments, Vincent. The patch is at its current phase very crude, more or less a quick try. The improvements you mentioned are easy to fix. It depends---only if there are members are interested in puting this feature further for their own use. A better version of it can be made and the patch can have more useful tools.
Joe

8O


Return to “Development”