New addon : Cosmological grid layer

Post requests, images, descriptions and reports about work in progress here.
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

New addon : Cosmological grid layer

Post #1by Cham » 09.08.2008, 13:37

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #2by ElChristou » 09.08.2008, 14:27

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))
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #3by Cham » 09.08.2008, 15:58

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.
Last edited by Cham on 09.08.2008, 16:00, edited 1 time in total.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #4by ElChristou » 09.08.2008, 16:00

No the message on screen is ok (activ?e, desactiv?e) but nothing else...
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #5by Cham » 09.08.2008, 16:01

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #6by ElChristou » 09.08.2008, 16:08

Got it!
Have you already put this into your start.celx layer?
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #7by Cham » 09.08.2008, 16:12

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 ?)
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #8by ElChristou » 09.08.2008, 16:25

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:
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #9by Cham » 09.08.2008, 16:32

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)
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #10by Cham » 09.08.2008, 16:53

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 ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #11by ElChristou » 09.08.2008, 17:13

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?
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #12by Cham » 09.08.2008, 17:23

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 !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #13by ElChristou » 09.08.2008, 17:35

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...
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #14by Cham » 09.08.2008, 18:24

I already tried some cubic lattice, but it's really messy. It's actually worst than having just a plane.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #15by ElChristou » 09.08.2008, 19:07

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
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #16by Cham » 09.08.2008, 19:14

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).
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #17by ElChristou » 09.08.2008, 21:28

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...
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: New addon : Cosmological grid layer

Post #18by Cham » 09.08.2008, 21:33

Did you made this modification in the CMOD file itself ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: New addon : Cosmological grid layer

Post #19by ElChristou » 09.08.2008, 21:51

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...
Image

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: New addon : Cosmological grid layer

Post #20by chris » 09.08.2008, 23:44

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


Return to “Add-on development”