phoenix wrote: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.
I just committed Vincent's arrow markers patch to CVS.
--Chris
That is good news.chris wrote:I just committed Vincent's arrow markers patch to CVS.
Code: Select all
Index: src/celengine/cmdparser.cpp
===================================================================
RCS file: /cvsroot/celestia/celestia/src/celengine/cmdparser.cpp,v
retrieving revision 1.32
diff -u -r1.32 cmdparser.cpp
--- src/celengine/cmdparser.cpp 29 Aug 2006 19:09:41 -0000 1.32
+++ src/celengine/cmdparser.cpp 17 Sep 2006 12:19:15 -0000
@@ -575,7 +575,9 @@
paramList->getNumber("size", size);
Vec3d colorv(1.0f, 0.0f, 0.0f);
paramList->getVector("color", colorv);
Color color((float) colorv.x, (float) colorv.y, (float) colorv.z, 0.9f);
+ double alpha = 0.9f;
+ paramList->getNumber("alpha", alpha);
+ Color color((float) colorv.x, (float) colorv.y, (float) colorv.z, alpha);
Marker::Symbol symbol = Marker::Diamond;
string symbolString;
Index: src/celestia/celx.cpp
===================================================================
RCS file: /cvsroot/celestia/celestia/src/celestia/celx.cpp,v
retrieving revision 1.84
diff -u -r1.84 celx.cpp
--- src/celestia/celx.cpp 29 Aug 2006 19:20:55 -0000 1.84
+++ src/celestia/celx.cpp 17 Sep 2006 12:21:36 -0000
@@ -2491,7 +2499,7 @@
static int object_mark(lua_State* l)
{
- checkArgs(l, 1, 4, "No arguments expected to function object:mark");
+ checkArgs(l, 2, 5, "No arguments expected to function object:mark");
Selection* sel = this_object(l);
CelestiaCore* appCore = getAppCore(l, AllErrors);
@@ -2512,9 +2520,18 @@
else if (markSize > 10000.0f)
markSize = 10000.0f;
+ float markAlpha = (float)safeGetNumber(l, 5, WrongType, "Fourth arg to object:mark must be a number", 0.9);
+ if (markAlpha < 0.0f)
+ markAlpha = 0.0f;
+ else if (markAlpha > 1.0f)
+ markAlpha = 1.0f;
+
+ Color markColorAlpha(1.0f, 0.0f, 0.0f, 0.9f);
+ markColorAlpha = Color::Color(markColor, markAlpha);
+
Simulation* sim = appCore->getSimulation();
sim->getUniverse()->markObject(*sel, markSize,
- markColor, markSymbol, 1);
+ markColorAlpha, markSymbol, 1);
return 0;
}
Cham wrote:Chris,
what about the asterisk and the circle ?
Vincent wrote:Circles and asterisk could be added very easily. But the point is to know whether these new forms are really usefull. Their shapes are very close to the other marker's shape. Why not using the same type of marker (diamond, square) but with different colours ?
Code: Select all
{
mark { object "Sol" size 32 color [ 1 1 0 0.5] symbol "uparrow" }
}
Code: Select all
{
mark { object "Sol" size 32 color [ 1 1 0] alpha 0.5 symbol "uparrow" }
}
Code: Select all
{
mark { object "Sol" size 32 color [ 0.5 0.5 0] symbol "uparrow" }
}
Cham,Cham wrote:Vincent,
I just tried your arrows markers. They are working, except the transparency. Changing the alpha value actually changes the color ! No transparency effect.
Code: Select all
Index: src/celengine/cmdparser.cpp
===================================================================
RCS file: /cvsroot/celestia/celestia/src/celengine/cmdparser.cpp,v
retrieving revision 1.32
diff -u -r1.32 cmdparser.cpp
--- src/celengine/cmdparser.cpp 29 Aug 2006 19:09:41 -0000 1.32
+++ src/celengine/cmdparser.cpp 17 Sep 2006 12:19:15 -0000
Code: Select all
@@ -575,7 +575,9 @@
Code: Select all
paramList->getNumber("size", size);
Vec3d colorv(1.0f, 0.0f, 0.0f);
paramList->getVector("color", colorv);
Color color((float) colorv.x, (float) colorv.y, (float) colorv.z, 0.9f);
Code: Select all
+ double alpha = 0.9f;
+ paramList->getNumber("alpha", alpha);
+ Color color((float) colorv.x, (float) colorv.y, (float) colorv.z, alpha);
Code: Select all
- checkArgs(l, 1, 4, "No arguments expected to function object:mark");
+ checkArgs(l, 2, 5, "No arguments expected to function object:mark");
This is the good way to use the alpha argument in cel scripts.Cham wrote:I also tried this :Code: Select all
{
mark { object "Sol" size 32 color [ 1 1 0] alpha 0.5 symbol "uparrow" }
}
The offset argument is included neither in the CVS version nor in my patch... Adding an offset argument that would vary relative to the distance, and so, that would need to be resized each time you mover the camera, would require a lot of code changes. All the other markers also keep their size when you change the distance between the object and the camera.Cham wrote:EDIT : And what about the offset option ? It doesn't work, apparently. I think the arrow should keep a distance from the object (Earth, in your example on the first page), so when you get closer, the arrow don't place itself inside the object. I think it should work the way you intended.
Cham, only the official devs can comit a patch to the CVS.Cham wrote:Vincent,
you should submit your transparency code to CVS.
Done.Cham wrote:And please, a "circle" marker ?
Cham wrote:Also, it could be great to add some text as a marker (or maybe in another way), to write few lines here and there floating in space. Something like the Milky Way's arms name (Orion arm, Perseus arm, etc), or just a "you are living there" with a red arrow indicating Earth. I don't want to see (clickable and annoying) billboards floating in space to show some fuzzy and pixelised text.
OK Chris, here's a zip file including :chris wrote:Vincent,
If you send me the patches for the marker alpha and the circle markers, I'll commit them to CVS. You really ought to get a propert SourceForge account
OK, that's done. The circle_markers_test.cel script that I've included in the zip file will give you some explanation about the relation between the size and the number of segments...chris wrote:If you haven't already done so, I recommend making the number of segments in the circle markers depend on the size of the marker. Otherwise, we'll end up with either with polygonal looking circles or drawing a lot of unnecessary lines.
chris wrote:I've been meaning to add names for markers. I think that this is a feature should be built into Celestia rather than done with Lua. Vincent, want to have a go at adding names to markers?
Vincent wrote:OK Chris, here's a zip file including :chris wrote:Vincent,
If you send me the patches for the marker alpha and the circle markers, I'll commit them to CVS. You really ought to get a propert SourceForge account
- the patch for the marker alpha and the circle markers
- a celestia_markers_test.exe file
- 4 test scripts (2 .cel and 2 .celx)
> http://vincent.gian.club.fr/celestia/ce ... s_test.zip
And I promise I'm going to get a sourceforge account as soon as possible...OK, that's done. The circle_markers_test.cel script that I've included in the zip file will give you some explanation about the relation between the size and the number of segments...chris wrote:If you haven't already done so, I recommend making the number of segments in the circle markers depend on the size of the marker. Otherwise, we'll end up with either with polygonal looking circles or drawing a lot of unnecessary lines.
I've also added a maximum size limit to avoid having a too high number of segments in the circle markers, and a minimum size limit (= 1) since 0 and negative values are not allowed in the case of circle markers.By "adding names to markers", do you mean "adding a string text as a marker", which is what Cham has suggested ? If that is the case, I may indeed be able to have a go at it... If not, could you please be a little bit more explicit ?chris wrote:I've been meaning to add names for markers. I think that this is a feature should be built into Celestia rather than done with Lua. Vincent, want to have a go at adding names to markers?