Page 1 of 2
Marking SOL
Posted: 22.08.2006, 05:16
by sfo2phx
If Celestia can already do this, indulge me because I haven't figured out how to do it.
I think it would be nice to be able to put a small brightly-colored crosshair marking Sol's location when you're "traveling," even if Sol itself is invisible. Can this be done? Or should it simply be filed away as an "enhancement suggestion" for future releases of Celestia?
The extrasolar star maps generated over at
Extrasolar Skies allow you to do this, and it's great for getting your bearings.
Posted: 22.08.2006, 05:26
by Cham
Yes, Celestia can do this. It's a standard procedure, actually. Use Ctrl-P to mark any selected object. If you want it permanent, you could add some command lines in the start.cel file, like this :
# script to mark all messier objects
mark { object "M1" size 20 color [ 0.0 0.5 0.5] symbol "square" }
mark { object "M2" size 20 color [ 0.0 0.5 0.5] symbol "square" }
mark { object "M3" size 20 color [ 0.0 0.5 0.5] symbol "square" }
... and so on ...
You have tons of options, here.
Posted: 23.08.2006, 05:53
by sfo2phx
Coolness! Thanks!
Posted: 30.08.2006, 02:04
by fsgregs
Cham:
In the script, what symbol shapes are available, beside "square"? Also, in the object statement, can it be anything being drawn in an ssc file? How do you point to it?
For example, are these correct statements???
mark { object "Sol" size 20 color [ 0.0 0.5 0.5] symbol "square" }
mark { object "HST" size 20 color [ 0.0 0.5 0.5] symbol "square" }, or would you have to state ...
mark { object "Sol/Earth/HST" size 20 color [ 0.0 0.5 0.5] symbol "square" }
Thanks in advance
Frank
Posted: 30.08.2006, 02:14
by Cham
I didn't tried it on an ssc object. I suspect it should work. Just try it, it should be easy to verify. I used that option to mark fictious solar systems, stars with real exoplanets, nebulae and Messier objects, and barycenters for multiple stars systems. The symbols you can use are these :
- x
- plus
- triangle
- diamond
- square
- probably simple symbols like "minus", "dot", or some others but I never tried.
Posted: 30.08.2006, 08:28
by Vincent
Frank, Cham,
Only these 5 symbols are available at the moment :
- x
- plus
- triangle
- diamond
- square
I've added the possibility to mark an object with an arrow in my own version. That was not an easy task because the size of the arrow must vary according to the size of the marked object... I got some quite satisfaying results. Here are some screenshots, with antialising disabled :
Posted: 30.08.2006, 15:28
by phoenix
this looks cool.
could you make a patch available?
Posted: 30.08.2006, 17:38
by Cham
I would prefer a scale independant arrow.
Posted: 30.08.2006, 18:13
by Vincent
Cham,
Sorry, I was not clear in my last post. The size of the arrow is of course independant from the marked object, and you can set it in the script :
Code: Select all
# Mark Earth with a size 20 red arrow...
mark { object "Sol/Earth" size 20 color [1 0 0] symbol "arrow" }
The point is that the arrow needed to be moved back on the left, with a distance that is relative to its own size (and so, that also depends on the object's size). So the gap is hardcoded : the arrow is drawn with an offset that is relative to its own size.
Another option would be to use an argument in the "mark" script function to set the gap (insted of having it hardcoded) :
Code: Select all
# Mark Earth with a size 20 red arrow, with a 40 pixels offset...
mark { object "Sol/Earth" size 20 color [1 0 0] symbol "arrow" offset 40}
phoenix,
Building a patch would be difficult since this feature belongs to one of my experimental versions of Celestia that includes a lot of changes... However, I'll be able to post the changes here quite soon...
Posted: 30.08.2006, 18:18
by phoenix
Vincent wrote: So the gap is hardcoded : the arrow is drawn with an offset that is relative to its own size.
yes, that's the part i'm really interested in.
phoenix,
Building a patch would be difficult since this feature belongs to one of my experimental versions of Celestia that includes a lot of changes... However, I'll be able to post the changes here quite soon...
thanks! I'm looking forward to see your changes
Posted: 30.08.2006, 18:18
by Cham
This is interesting. You should submit this to Chris, as I think we should have a little more markers options.
Posted: 30.08.2006, 22:19
by Vincent
Here are the changes :
.../src/celengine/marker.cpp (~ line 140 )
Code: Select all
case Triangle:
glBegin(GL_LINE_LOOP);
glVertex3f(0.0f, s, 0.0f);
glVertex3f( s, -s, 0.0f);
glVertex3f( -s, -s, 0.0f);
glEnd();
break;
// Add Arrow Marker - start - Vincent
case Arrow:
glBegin(GL_POLYGON);
glVertex3f(-2*s-s, float(s/3), 0.0f);
glVertex3f(-2*s-s, float(-s/3), 0.0f);
glVertex3f(-s-s, float(-s/4), 0.0f);
glVertex3f(-s-s, float(s/4), 0.0f);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-s-s, float(2*s/3), 0.0f);
glVertex3f(-s-s, float(-2*s/3), 0.0f);
glVertex3f(-s, 0.0f, 0.0f);
glEnd();
break;
// Add Arrow Marker - end - Vincent
}
}
.../src/celengine/marker.h (~ line 44 )
Code: Select all
enum Symbol
{
Diamond = 0,
Triangle = 1,
Square = 2,
Plus = 3,
X = 4,
// Add Arrow Marker - start - Vincent
Arrow = 5
// Add Arrow Marker - end - Vincent
};
Symbol getSymbol() const;
void setSymbol(Symbol);
.../src/celengine/cmdparser.cpp (~ line 594 )
Code: Select all
else if (compareIgnoringCase(symbolString, "x") == 0)
symbol = Marker::X;
// Add Arrow Marker - start - Vincent
else if (compareIgnoringCase(symbolString, "arrow") == 0)
symbol = Marker::Arrow;
// Add Arrow Marker - end - Vincent
}
cmd = new CommandMark(object, color, (float) size, symbol);
.../src/celestia/celx.cpp (~ line 926 )
Code: Select all
else if (compareIgnoringCase(name, "x") == 0)
return Marker::X;
// Add Arrow Marker - start - Vincent
else if (compareIgnoringCase(name, "arrow") == 0)
return Marker::Arrow;
// Add Arrow Marker - end - Vincent
else
return Marker::Diamond;
Cham wrote:This is interesting. You should submit this to Chris, as I think we should have a little more markers options.
Well, I'm an "idea handyman" more than a coder
... So I'm sure Chris could do this in a nicer way... Maybe later, because we all know he is working hard on other improvements, along with the other devs... Anyway, if the dev team is interested in it, they can of course use the idea and/or the piece of code for the official version.
Posted: 30.08.2006, 22:35
by chris
Vincent wrote:Well, I'm an "idea handyman" more than a coder
... So I'm sure Chris could do this in a nicer way... Maybe later, because we all know he is working hard on other improvements, along with the other devs... Anyway, if the dev team is interested in it, they can of course use the idea and/or the piece of code for the official version.
I think that this is worth adding. It might be nice to have arrows in several different directions: rightarrow, uparrow, etc.
Vincent, do you have a SourceForge account?
--Chris
Posted: 31.08.2006, 08:41
by Vincent
Chris wrote:Vincent, do you have a SourceForge account?
Chris,
I use an anonymous account to update Celestia from the CVS, so I can't comit my changes for now.
Chris wrote:It might be nice to have arrows in several different directions: rightarrow, uparrow, etc.
I think I can work on it. I can also add the
"offset" argument to the mark function if you prefer the "gap" to be set in the script, rather than keeping it hardcoded...
Posted: 31.08.2006, 11:14
by Vincent
Chris (and all other interested users...)
I've added the 4 types of arrows : leftarrow, uparrow, rightarrow and downarrow.
You can download a zip file including :
- a patch file built from the latest CVS version (updated 5 mn ago)
- a .exe file built from the latest CVS version modified with the patch
- a .cel script file to test the arrow markers feature
>
http://vincent.gian.club.fr/celestia/ce ... arkers.zip
Here are some screenshots :
Posted: 05.09.2006, 23:43
by chris
Thanks for this, Vincent. I'll check this change into CVS.
--Chris
Posted: 06.09.2006, 11:46
by Vincent
You're welcome Chris.
Just one last thought... These arrows may diserve a bit of transparency. So what about adding an new
alpha argument (0 = totally transparent , 1 = totally opaque) to the
mark function ?
Code: Select all
mark { object "Sol/Earth"
size 15
color [0 1 0]
alpha 0.7
symbol "rightarrow" }
I had a look at the code, and I noticed that this would be applied to all types of markers. So, setting the alpha argument to the default value 1 would avoid breaking previous scripts/addons.
/EDIT/
The
alpha value could also be declared as the 4th number of the
color argument :
Code: Select all
mark { object "Sol/Earth"
size 15
color [0 1 0 0.7] # Red=0; Green=1; Blue=0; Alpha=0.7
symbol "rightarrow" }
Posted: 16.09.2006, 21:36
by Vincent
Hi,
I have added a new
alpha argument to the
mark function to set the transparency of the markers.
This argument can be used with all types of markers.
The alpha argument can have values from 0 (-> marker totally transparent) to 1 (-> marker totally opaque).
This works both in cel and celx scripts.
Here are some shots for
alpha=0.9 (which is the value of transparency in the current CVS version ),
alpha=0.7 and
alpha=0.5.
*****************************************************
IMHO, the arrow-marker looks better integrated into the background scene in the last 2 shots thanks to the transparency effect...
I can provide a new patch (from the last CVS) if you're interesting in this feature.
*****************************************************
Posted: 16.09.2006, 21:40
by Cham
Is this code integrated in CVS right now ?
Can you also add an asterisk and a circle markers ?
Posted: 16.09.2006, 22:13
by phoenix
Cham wrote:Is this code integrated in CVS right now ?
I don't think so.
But as chris said he was going to add this.