Page 1 of 1
How to create a galaxy?
Posted: 21.06.2009, 00:11
by thefallenghost
What is my best option if I want to add NGC 6240 to Celestia 1.6.0 RC3. What I mean is what I should do (I don't want to take a lifetime making a model) and how to do it. A 2d image is an option for me. (see
http://apod.nasa.gov/apod/ap090618.html)
Thanks.
Re: How to create a galaxy?
Posted: 21.06.2009, 09:11
by t00fri
thefallenghost wrote:What is my best option if I want to add NGC 6240 to Celestia 1.6.0 RC3. What I mean is what I should do (I don't want to take a lifetime making a model) and how to do it. A 2d image is an option for me. (see
http://apod.nasa.gov/apod/ap090618.html)
Thanks.
In case you have overlooked this dim object (13.8m), let me emphasize that it is of course included already in Celestia. ALL NGC/IC objects are included essentially.
In order to see it, you must simply increase the light sensitivity by pushing the ] key a bit. Moreover, make sure to have enabled the automag feature (CTRL+y key).
Here is a little screen shot of Celestia's NGC 6240
Note that in Celestia we display galaxies how they appear to the unaided eye or at best in a small telescope. NGC 6240 has been classified as a spherical galaxy (Hubble type E0) and that is what I have rendered.
If you prefer to replace it by something like a super-hires Hubble photograph, you can do this via an add-on in the extras folder. Just download one of the many user-made add-on galaxies from the Motherlode (
http://www.celestiamotherlode.net/) and see how they were done. Any example should be self-explaining. To suspend a 2d photo is VERY easy. You should only take care that you are not displaying BOTH, the default galaxy AND the new one on top of each other...
Fridger
Re: How to create a galaxy?
Posted: 21.06.2009, 12:46
by thefallenghost
I undertand that it is already in celestia. What I would like to do is to superimpose the current model with a picture. I have looked up a couple of 2d suspended addons, but they all require a mesh, and I don't quite know how to do that.
Re: How to create a galaxy?
Posted: 21.06.2009, 13:25
by selden
If it helps, a prescription for displaying flat pictures in Celestia is at
http://www.lepp.cornell.edu/~seb/celest ... -cmod.html
Re: How to create a galaxy?
Posted: 21.06.2009, 13:39
by t00fri
thefallenghost wrote:I undertand that it is already in celestia. What I would like to do is to superimpose the current model with a picture. I have looked up a couple of 2d suspended addons, but they all require a mesh, and I don't quite know how to do that.
But if you just overlay the original, spherical NGC 6240 with a 2d photo, it will look really bad when you get closer. That's why people try to use meshes. Ever thought of just borrowing a mesh from another add-on?
Fridger
Re: How to create a galaxy?
Posted: 21.06.2009, 17:49
by thefallenghost
This is what I have now:
in my extra/NGC6240,
+ngc 6240-cmod.dsc:
Nebula "+NGC 6240"
{
RA 16.8828
Dec 2.4031
Distance 3.264e+08 # method: V_cmb
Radius 9.97e+04
Type "E0"
Angle 153.7811
Axis [ 0.0278 -0.8329 -0.5527]
InfoURL "http://simbad.u-strasbg.fr/sim-id.pl?Ident=NGC 6240"
Mesh "+ngc6240.cmod"
}
in my extras/NGC6240/textures/medres:
+ngc 6240.png (4096x4096 png file with transparency [I have tried smaller pictures and they didn't work either])
in my extras/NGC6240/models:
+ngc 6240.cmod:
material
texture0 "+ngc 6240.*" # modify this filename to display other images
diffuse 1 1 1 opacity 1 end_material
mesh
vertexdesc position f3 normal f3 texcoord0 f2 end_vertexdesc
vertices 4
0 0 0 0 1 0 0 1
0 0 1 0 1 0 0 0
1 0 1 0 1 0 1 0
1 0 0 0 1 0 1 1
# the "negative" side: facing the origin
trilist 0 6 0 3 2 2 1 0
# the "positive" side: facing away from the origin
trilist 0 6 0 1 2 2 3 0
end_mesh
Why doesn't it work?
Re: How to create a galaxy?
Posted: 22.06.2009, 08:13
by t00fri
Sorry, I got no time to check for mistakes in your attempts. Selden's instructions are so detailed that all you got to do is to make sure that you didn't introduce a typo...
Instead, I made you --in less than 5 minutes-- a fresh NGC 6240 add-on, which works and may be downloaded from here:
http://www.celestiaproject.net/~t00fri/images/NGC6240.zipunzip it in your extras folder. That's all.
One remark about the image file: to get the size about right, I cut out the galaxy from the Hubble-Spitzer image with a square selection. Next, it is crucial that towards its square boundary, the image really becomes BLACK! Otherwise it looks VERY nasty, since you can see the brighter square against the black background.
Since one doesn't want to modify the main galaxy much, the method of choice is to overlay a layer in GIMP, which carries a radial gradient that is transparent in the center and becomes black towards the border. Merge the two layers ==> done. That's what I did for you in the add-on.
Instead of an non-transparent JPG file, you may also add an alpha channel that provides transparency. Then you got to use PNG format of course. But I wanted to keep things simple, at first.
With a gray alpha channel ("Colors->Color to Alpha ..." in GIMP), you can overlay the 2d image with the 3d default galaxy. But it doesn't look nice, since the square border of the 2d texture sticks out against the bright background from the 3d default galaxy.
Here is how it looks:
Anyway, here is the transparent NGC 6240 image version for you to play...
http://www.celestiaproject.net/~t00fri/images/ ... hubble.pngdon't forget to adapt the name in the billboard1.cmod!
Personally, I would never implement a galaxy in this unattractive manner.
Fridger
Re: How to create a galaxy?
Posted: 22.06.2009, 11:11
by selden
You might be having a problem because you've used punctuation in the file names. Try eliminating the "+" and " " (space) from them all. Using anything other than letters, numbers and underscores in file names is asking for trouble.
Re: How to create a galaxy?
Posted: 29.06.2009, 17:39
by thefallenghost
I've tried cutting out only the galaxy, but now I cant get it at the right angle.
This is what the png looks like:
This is how it's supposed to be:
http://aladin.u-strasbg.fr/java/nph-aladin.pl?script=get+Aladin+NGC++6240+11arcmin%3Bget+simbad+NGC++6240+11arcmin&from=Simbad4&submit=Aladin+appletAnd this is how it appears in Celestia using the default axis and angle for this galaxy:
I've also tried Grant Hutchinson's spreadsheet and it doesn't seem to work.
Also, how do I take out the existing 3d default model for this galaxy?
Re: How to create a galaxy?
Posted: 29.06.2009, 18:03
by selden
Many astronomical photographs have a random orientation relative to the sky: they are not oriented with their tops pointed North. As a result, Celestia's default orientation is wrong for them. You must specify a different orientation in the DSC definition of the object.
Grant's spreadsheet works fine for me.
Instructions for how to align DSC objects with or without Grant's spreadsheet are in
http://www.lepp.cornell.edu/~seb/celest ... -cmod.htmlTo eliminate one of Celestia's default galaxy objects, you must use your favorite text editor to remove it from Celestia/data/galaxies.dsc
Re: How to create a galaxy?
Posted: 29.06.2009, 19:42
by thefallenghost
First, Grant's calculations give me this:
Axis [-0.1205 0.8411 0.5272]
Angle 170.538
Second, all the data files are read-only and I don't know how to modify them. However, the "read-only" box is not checked in the properties of "galaxies.dsc".
Re: How to create a galaxy?
Posted: 29.06.2009, 19:50
by selden
Grant's spreadsheet assumes North is up in the picture. When it isn't, you must use Celestia's real-time method of alignment to rotate the picture so that it aligns correctly. Please read the Web page mentioned above, section 6.2.
Presumably you're using Vista. Please read the FAQ at
viewtopic.php?f=15&t=13461Vista Question #3:
# Why can't I make changes to files in the Celestia data directory?
Re: How to create a galaxy?
Posted: 29.06.2009, 20:38
by thefallenghost
I'm done with the alignment problem, thanks for the help!
However, I'm currently running XP, not Vista. Also, I don't suppose there's any way of modifying or replacing a dsc object, right?
Re: How to create a galaxy?
Posted: 30.06.2009, 11:03
by selden
If you're running XP, it sounds like you may have installed Celestia while an administrator and be trying to modify it while running without privileges.
You might try deinstalling Celestia and reinstalling it.
Alternatively, you might try
1. changing the protection of the Celestia directory tree and its contents so that your username has all access rights, and then
2. "take ownership" of the Celestia directory tree and its contents.
You must perform both steps in order to be able to edit the files.
Re: How to create a galaxy?
Posted: 30.06.2009, 16:14
by thefallenghost
I managed to un-read-only the data folder.
Also, why does the billboard have very intense colours inside Celestia whereas it does not in Gimp before or after adding an alpha channel?
Re: How to create a galaxy?
Posted: 30.06.2009, 16:46
by selden
They're options in the Properties popup menu's Security tab.
Right click on the folder and select Properties in the popup menu.
If you haven't already done so, you should invest in one or more of the Windows XP administration manuals by various authors. They're available from your favorite local bookseller. You need to browse through them to find the ones which best match your level of experience.
Re: How to create a galaxy?
Posted: 08.07.2009, 16:06
by thefallenghost
Yes, but what about the colours?