Page 1 of 2

New addon : Cosmological grid layer

Posted: 09.08.2008, 13:37
by Cham
Here's a cosmic grid layer. Very usefull to show the scale of the universe up to 10 billions of LY and to help the user to orient himself into the void. The following version is in French and includes an alternate polar grid (the default is a cartesian grid). If there is some interest, I may do an English version. No feedback, no candy ! :roll:

A simple view :
cosmic1.jpg

Another view, with Fridger's galactic markers :
cosmic2.jpg


The addon with toggle script (French version) :
Cosmic_scale.zip


To be used with the latest SVN Celestia only.

By default, the layer is invisible. To activate it, you need to turn ON the nebulae AND to use the toggle script. The keyboard switch is "S" (shift-s).

Other cosmological layers to come : the CRB (Cosmological radiation background), some galactic views in infra-red, ultraviolet, x-rays, radio frequency, etc. Hydrogen clouds, etc.

Please Chris, don't forget to add the clickable false command to the DSC level.

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 14:27
by ElChristou
Cham, apart the labels and eventually the script, is there a fundamental difference with Selden's graticules?

Edit, just tested and... don't work for me... :( (the text on screen is present but not the grids...(and yes, nebulas are ON))

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 15:58
by Cham
ElChristou wrote:Cham, apart the labels and eventually the script, is there a fundamental difference with Selden's graticules?

Edit, just tested and... don't work for me... :( (the text on screen is present but not the grids...(and yes, nebulas are ON))

Well, my grid is simpler than Selden's. And I added the labels. My grid can be toggle ON/OFF because of its DSC and CELX files. So apart that, there's no fundamental differences.

The labels are visible, while the grids aren't ? I don't understand why. Did you edited something ? By default, the grids (and the labels) aren't visible even if you turn ON the nebulae. You need to use the script to toogle ON/OFF the layer.

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:00
by ElChristou
No the message on screen is ok (activ?e, desactiv?e) but nothing else...

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:01
by Cham
ElChristou wrote:No the message on screen is ok (activ?e, desactiv?e) but nothing else...

You need to turn the layer visible with the celx script, and the nebulae must be turned ON too. You need both.

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:08
by ElChristou
Got it!
Have you already put this into your start.celx layer?

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:12
by Cham
ElChristou wrote:Got it!
Have you already put this into your start.celx layer?

Yes, of course. It's working like a charm ! 8)

The layers are really a great thing for Celestia. There are so much things we can show, now, using this technique. The CMRB (radiation background) will be a great addition too.

Maybe I should also add the parsec and km scales, on the labels (not just LY ?)

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:25
by ElChristou
Cham wrote:
ElChristou wrote:Got it!
Have you already put this into your start.celx layer?

Yes, of course. It's working like a charm ! 8)

You can post? :wink:

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:32
by Cham
ElChristou wrote:You can post? :wink:

Here's the part of my start.celx file which defines this layer (don't forget to open/save under the UTF-8 format) :

Code: Select all

---------------------------------------------------------------
---------------------------------------------------------------
CosmicGrid_t = {
      "Grille Cartesienne 1",
      "Grille Cartesienne 2",
      "Grille Cartesienne 3",
      "Grille Cartesienne 4",
      "Grille Cartesienne 5",
      "Grille Cartesienne 6",
      "Grille Cartesienne 7",
      "Grille Cartesienne 8",
      "Grille Cartesienne 9",
      "Grille Cartesienne 10",
      "Grille Cartesienne 11",

      "0.1 AL",
      "1 AL",
      "10 AL",
      "100 AL",
      "1000 AL",
      "10_4 AL",
      "10_5 AL",
      "10_6 AL",
      "10_7 AL",
      "10_8 AL",
      "10_9 AL",
      "10_10 AL"
}

for k, object in pairs(CosmicGrid_t) do
  CosmicObj = celestia:find(object)
  CosmicObj:setvisible(false)
end

function toggleCosmicGrid()
  for k, object in pairs(CosmicGrid_t) do
    cosmicGrid = celestia:find(object)
    cosmicGrid:setvisible(not cosmicGrid:visible())

   if cosmicGrid:visible() then
      celestia:print("Grille cosmologique activ?e", 2)
   else
      celestia:print("Grille cosmologique d?sactiv?e", 2)
   end
  end
end
---------------------------------------------------------------
---------------------------------------------------------------
keyhandlers =
{
         G = fastgoto,
         d = toggleHorizontalGrid,
         D = toggleEclipticGrid,
   ["C-d"] = toggleGalacticGrid,
         T = togglePolar,
    S = toggleCosmicGrid,

   ["C-1"] = toggleObj1,
   ["C-2"] = toggleObj2,
   ["C-3"] = toggleObj3,
   ["C-4"] = toggleObj4,
   ["C-5"] = toggleObj5,
   ["C-6"] = toggleObj6,
   ["C-7"] = toggleObj7,
   ["C-8"] = toggleObj8,
   ["C-9"] = toggleEarthSurfaceFeatures,
   ["C-0"] = toggleObj0
}

function handlekey(k)
    handler = keyhandlers[k.char]
    if (handler ~= nil) then
        handler()
        return true
    else
        return false
    end
end

celestia:registereventhandler("key", handlekey)

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 16:53
by Cham
I'm trying to decide if this is better, in the case of the first and last labels :

First "cosmic" label :
cosmicgrid1.jpg

Same view with my ecliptic polar grid layer activated :
cosmicgrid1b.jpg

The last label :
cosmicgrid2.jpg


Any opinion ?

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 17:13
by ElChristou
Those labels are great. A bit present but still great.
Tx for the script.
Question, could you add to the cmod a little something to give a spacial indication of the 3rd axis?

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 17:23
by Cham
ElChristou wrote:Question, could you add to the cmod a little something to give a spacial indication of the 3rd axis?

Easy. There are two choices here :

1. modify the CMOD file to add a third axis (I prefer not this solution)
2. Add a new CMOD file just for the third axis, with a declaration in the SSC and in the script.

In both cases, the CMOD third axis is simply defined by this code (arbitrary lenght, and using the yellow color for the moment) :

Code: Select all

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   0   -1
0   0   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   0   1
0   0   10

linestrip 0  2
0
1
end_mesh


I didn't tried it, but you can test it by yourself by copying and pasting this code into the CMOD file itself (just at the end of the data). Tell me how it's working for you and post a picture !

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 17:35
by ElChristou
This line is ok, but we need some points to give us the scale... I wonder if a kind of cube in dotted line around the present plane could not give this reference...

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 18:24
by Cham
I already tried some cubic lattice, but it's really messy. It's actually worst than having just a plane.

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 19:07
by ElChristou
Cham wrote:I already tried some cubic lattice, but it's really messy. It's actually worst than having just a plane.

Even a simple cube like this? (I think it could work but only if well differenced -> dotted lines)
grid1.jpg


Or this one could work great I think:
grid2.jpg

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 19:14
by Cham
ElChristou wrote:Even a simple cube like this? (I think it could work but only if well differenced -> dotted lines)
grid1.jpg


Or this one could work great I think:
grid2.jpg

I already tried a configuration like these before, but it's confusing in Celestia. And the third axis doesn't help much to locate objects. A simple galactic plane is enough for most purposes (especially to show the various scales of the universe). The plane is just a reference grid to help oriente ourselves into the emptiness of space. It's very similar to what we have in Cheetah3D (a reference grid similar to what is shown in your pictures).

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 21:28
by ElChristou
Cham wrote:...And the third axis doesn't help much to locate objects. A simple galactic plane is enough for most purposes (especially to show the various scales of the universe)...
I disagree a bit here. Ok, the grid is nice to "feel" a bit better the space, but a third axis is quite useful to feel better the spacial position of bodies and help to link with the near plane and it's scale. This give an idea of the distances of those bodies that are not at all near the galactic plane. Look, I've added some vertices:

grid3.jpg


When you moved/rotate the system it's quite interesting...

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 21:33
by Cham
Did you made this modification in the CMOD file itself ?

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 21:51
by ElChristou
Yep but find here the vertices:

Code: Select all

mesh vertexdesc position f3 end_vertexdesc

vertices  2
10   0   10
10  0   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
-10  0   -10
-10  0   10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
-10  0   -10
10  0   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
10   0   10
-10  0   10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   10   10
0  10   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   -10   -10
0  10   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   -10   10
0  -10   -10

linestrip 0  2
0
1
end_mesh

mesh vertexdesc position f3 end_vertexdesc

vertices  2
0   10   10
0  -10   10

linestrip 0  2
0
1
end_mesh


And perso I lowered the opacity of both material to 0.2 to avoid too strong lines...

Re: New addon : Cosmological grid layer

Posted: 09.08.2008, 23:44
by chris
ElChristou wrote:
Cham wrote:...And the third axis doesn't help much to locate objects. A simple galactic plane is enough for most purposes (especially to show the various scales of the universe)...
I disagree a bit here. Ok, the grid is nice to "feel" a bit better the space, but a third axis is quite useful to feel better the spacial position of bodies and help to link with the near plane and it's scale. This give an idea of the distances of those bodies that are not at all near the galactic plane. Look, I've added some vertices:

grid3.jpg


When you moved/rotate the system it's quite interesting...

I like this version with the extra vertices: it shows the some reference in the third dimension, but doesn't add too much clutter.

--Chris