Fireworks in space ! (globular clusters testing)

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Fireworks in space ! (globular clusters testing)

Post #1by Cham » 25.12.2006, 21:30

Since I'm in vacation, I use my time to test some ideas about globular clusters representations, using some CMOD models. Instead of making a huge STC file of fictious stars, I'm building some random spherical distribution of dots. The pure CMOD format is really under exploited by all the Celestia creators. So I'll try to convince some to make their own experimentations with this format. Here's a testing ball of random dots distributed on a sphere. While moving close to it, the ball grows and it really feels like a firework in space !

Image

A typical CMOD file of dots is like this (in this case, there are only four dots in this code) :

Code: Select all

#celmodel__ascii

material
  emissive 1 1 0
  diffuse 1 0 0
  opacity 1
end_material

mesh
  vertexdesc position f3 end_vertexdesc

vertices  4
0.8658485885146612       0.2426581291531574       -0.43751943285191164
0.09960431714365557      -0.8865045061998517      0.4518724825586342
-0.9508415773552661      -0.2907842543243548      0.10651202847368269
0.694091501772355        -0.5857211989415121      -0.41853036243254127

points 0  4
0
1
2
3

end_mesh



Next, I'll try to make a fuzzy ball of dots distributed inside the sphere, with a "nucleus", and various colors.
"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

Post #2by Cham » 25.12.2006, 22:30

Here's a simple rendering test :

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

Post #3by Cham » 25.12.2006, 23:01

The parameters I'm controlling for this "fuzzy ball" distribution are the total number of dots, the size of the ball, the radial distribution shape and the number of dots per spherical layer. The color is global (defined in the CMOD file). I'm not sure I'll be able to make a color variation inside the fuzzy ball without doing it by hand (which could be a lot of work).

Since my Mathematica code is done, generating an arbitrary fuzzy ball is extremelly easy and is a matter of seconds.
"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

Post #4by Cham » 25.12.2006, 23:17

It's possible to put some (fake) stars in other galaxies, with the model defined as a nebula.

The advantage of this method is it's extremely fast in Celestia, since the model is only a bunch of luminous dots.

Later, I'll try to make a spiral pattern of random dots.

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

Post #5by Cham » 25.12.2006, 23:28

I forgot to tell that I'll also try to simulate an accretion disk with this technique. I'll use several layers of oblate shells rotating with a differential angular velocity. I think I may achieve a "fluid" like motion and a real 3D effect. Of course, the global aspect will not be like a smooth distribution of gas, but it may be very interesting nonetheless.
"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

Post #6by Cham » 26.12.2006, 00:27

In case someone want to play with a spherical layer and a simple fuzzy ball, here's a link to both CMOD files :

http://nho.ohn.free.fr/celestia/Cham/Divers/balls.zip (48 KB zip file)
"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!"

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #7by BlindedByTheLight » 26.12.2006, 00:30

Don't know if I know how to play with it myself...but looks good!

Thanks!
Steven Binder, Mac OS X 10.4.10

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #8by selden » 26.12.2006, 00:45

Cham,

In principle, you should be able to persuade Mathematica to generate an appropriately random set of colors (and thus brightness) in addition to random radial distances with an appropriate distribution: the stars don't have to be in shells.
Selden

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

Post #9by Cham » 26.12.2006, 01:04

Selden,

really, I don't know how to do that with Mathematica. The problem is to export the data in a proper way, so I could easily paste it into a CMOD file.

Currently, I don't know how to tell Mathematica to make all the CMOD headers and formatting. It's just exporting the coordinates as three columns of numbers, and all I have to do is to paste that data into a proper CMOD file. So my method doesn't let me define the colors within Mathematica.
"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
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #10by selden » 26.12.2006, 01:15

Colors are just three numbers, too :)

I think you can use StringForm to create the text parts of a CMOD flie.

http://documents.wolfram.co.jp/mathemat ... tion-2.9.6
Selden

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

Post #11by Cham » 26.12.2006, 01:18

Thanks Selden, I'll check this.

And here's another example of fake stars cluster :

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

Post #12by Cham » 26.12.2006, 06:47

Here's a good one. 3989 "stars". It's fun to travel inside.

Image

http://nho.ohn.free.fr/celestia/Cham/Di ... 2.cmod.zip (128 KB zip file)

The radial profile is an exponential probabilistic distribution (I removed the layers I was using at first). Should I use a gaussian (normal) radial distribution ?

Please, tell me what you think of this chip.


EDIT : It may be usefull to know how this format (CMOD) is working, so here's a micro-tutorial. Below is a typical code for a distribution of dots :

#celmodel__ascii

material
emissive 1 1 0
diffuse 1 0 0
opacity 1
end_material

mesh
vertexdesc position f3 end_vertexdesc

vertices 4
0.8658485885146612 0.2426581291531574 -0.43751943285191164
0.09960431714365557 -0.8865045061998517 0.4518724825586342
-0.9508415773552661 -0.2907842543243548 0.10651202847368269
0.694091501772355 -0.5857211989415121 -0.41853036243254127

points 0 4
0
1
2
3

end_mesh


The red numbers are RGB color definitions. You can change them to any numbers you want, but they must lie between 0 and 1.

The yellow number is the transparency effect (alpha). You can change it to any number between 0 and 1. Of course, 0 means "totally transparent" while 1 means "opaque".

The vertices number defines the coordinates of dots (vertices, actually).

The number 0 defines the material assignement, which is declared in the header (0 is associated to the first material declaration, 1 is the second material in the header, etc...) In the example above, there's only one material definition.

The number 4 is the number of vertices which are rendered as "dots" (points). This number may be different than the number of vertices.

There are some other options for this format, which permits the definition of lines between vertices, dash lines, etc, but I will not describe them here.
"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

Post #13by Cham » 26.12.2006, 19:54

Now, I'm hitting a problem that kills the whole project >8-(

The model used as a nebula doesn't have a distance dependant brightness. At close range, it looks nice, but at large distance, it's annoying :

Image

Image

Another Celestia limitation that chop the creator's legs. Too bad. End of topic.
"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
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #14by t00fri » 26.12.2006, 20:54

Cham,

there are other aspects that tend to kill the whole project.

If you try to include many open clusters (>= 500, say) as add-ons, the highly effective octree culling mechanism is lacking! Hence by including many such add-ons the performance will be VERY slow.

Also by coding open cluster methods within the respective class, it is very easy to generate random star distributions according to an arbitrary pobability distribution (using the acceptance-rejection method very familiar from MonteCarlo techniques) .

Moreover, like for galaxies, an appropriate color profile can easily be incorporated.

Bye Fridger
Image

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

Post #15by Cham » 26.12.2006, 21:08

My globular clusters project was actually just a pretext to use pure CMOD models. I like very much that format, and I want it to be used more often, as diagrams, schematics, magnetic fields, light trajectories, various kind of information layers, etc. So I'm looking for more ideas about how to use them.

I have tons of ideas, but I'm lacking the data, the skills, the knowledge or know-how to implement them. This is very frustrating.

I want the galactic magnetic field lines to be drawn as an information layer that could be toggled ON and OFF at will. I want nebulae and gas clouds contours to be drawn, I want vector fields of various types, etc.

O well, I'm just dreaming ... :cry:
"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!"

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 19 years 9 months
Location: Switzerland

Post #16by neo albireo » 27.12.2006, 13:05

Cham wrote:My globular clusters project was actually just a pretext to use pure CMOD models. I like very much that format, and I want it to be used more often, as diagrams, schematics, magnetic fields, light trajectories, various kind of information layers, etc. So I'm looking for more ideas about how to use them.

I want the galactic magnetic field lines to be drawn as an information layer that could be toggled ON and OFF at will.


I agree totally. Maybe a fast first step that provides a great advancement would be to have the option to toggle CMOD models on/off generally. Right now, I can place addons at another location, around another star etc. if I don't want the original solar system version stuffed with addons. p.e. Runar's Sun or things like a dying system addon that alter the appearance of the solar system dramatically, I place them just somewhere else than in our solar system and can fly there to show everything.
But: If I add CMOD models, i.e. the excellent deep space addons 2df_300k-cmod and sdss-dr2-v2, the points are just there to stay. So each time I present Celestia to somebody, I first tour the solar system and show some galaxies. Then I have to quit Celestia, put those addons into the extra folder and restart Celestia in order to show the bubble structure of the galaxy distribution. :cry: This is absolutely disappointing and I hope that it would not require a lot of work to include a toggle CMOD option. Please! Or is there already a key that I haven't discovered yet?

I think as a first step a simple toggle option would be sufficient. If you are showing the magnetic field addon, it does not disturb so much to have the deep space data points at the same time, as the feeling with Celestia changes immediately anyway: It becomes more an abstract scientific tool than without the CMODs. So I think even if you have many CMOD files, they can all coexist at the same time, but very often you just don't want to have ANY CMOD's in order to show an impressive photorealistic view of the universe without additional data. Of course additional layers would be even nicer :wink:

Monolyth
Posts: 31
Joined: 27.11.2006
With us: 17 years 11 months
Location: Tucson, AZ USA

Post #17by Monolyth » 29.12.2006, 18:11

its seems as if there is a need for a cmod editor for celestia....this is interesting

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #18by selden » 29.12.2006, 21:00

Yup -- one that understands lines and points, not just triangles as most 3D modelling software packages do.

Often, however, models need to be created algorithmically, as Cham has done to represent magnetic fields. Since it's relatively simple and well documented, ASCII CMOD format is well suited for this.
Selden

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

Post #19by Cham » 29.12.2006, 21:09

While a CMOD editor could be very usefull, I don't see how I could use a CMOD editor in many cases, since I have to develop some mathematical curves.

Since a week, I fights against Mathematica to draw some sophisticated magnetic field lines. I hope to be able to finish this project very soon.
"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!"


Return to “Development”