Confusion on how to convert coorrdinates

General discussion about Celestia that doesn't fit into other forums.
Topic author
MEaster
Posts: 4
Joined: 19.07.2008
With us: 16 years 4 months

Confusion on how to convert coorrdinates

Post #1by MEaster » 15.08.2008, 22:02

Hi, I'm trying to recreate the map from EVE Online in Celestia using the data dump provided by CCP, but don't have a clue as to how I would go about placing the systems correctly. I've managed to create single systems, around a single star I've created, but I want to recreate the whole EVE map.
Now the coordinates in the data dump are given in metres from an arbitrary centre point, for example, the Isinokka system has the coordinates X:-2.27900411575087e+017 Y:1.17927964021785e+017 Z:-1.80978764473085e+017 from this central point. The problem is how I would go about setting this central point where I choose(via a barycentre, I guess) and placing the stars in the correct position around this central point.

There's 5,431 stars in EVE Online, so doing them by eye isn't an option. :mrgreen:

bdm
Posts: 461
Joined: 22.07.2005
With us: 19 years 4 months
Location: Australia

Re: Confusion on how to convert coorrdinates

Post #2by bdm » 16.08.2008, 01:23

You will need to convert from 3d cartesian coordinates to polar coordinates. This should not be difficult but you need to specify a frame of reference.

Suppose we specify the following:
* positive x axis is equivalent to RA 0, Dec 0
* positive y axis is equivalent to RA 6 (RA 90 degrees), Dec 0
* positive z axis is equivalent to Dec +90
* assume one light year is equal to the distance light travels in a Julian year (365.25*86400*299792458 = 9,460,730,472,580,800 metres). (NOTE: Celestia's light year may have a slightly different length but as long as the distance is roughly right and all distances are divided by the same value then the results will come out okay.)

Then it should be possible to apply some trigonometry or vectors to convert the co-ordinates. It's been more than twenty years since I did this kind of maths so it may be necessary for you to do some research online.

But I do know that the distance is equal to the square root of (x^2 + y^2 + z^2). Divide this by 9,460,730,472,580,800 to get a distance in light years.

My familiarity with Eve Online makes me think that you will eventually want to link these star systems with lines to represent the jump routes. Ways of doing this are discussed in this topic: Lines between stars or fictional planet systems.

bdm
Posts: 461
Joined: 22.07.2005
With us: 19 years 4 months
Location: Australia

Re: Confusion on how to convert coorrdinates

Post #3by bdm » 16.08.2008, 01:28

As for a central point, I think vectors would be the easiest way of setting a central point. If you wanted to make the system at (X:-2.27900411575087e+017 Y:1.17927964021785e+017 Z:-1.80978764473085e+017) the central point, all you need to do is define a vector with i:-2.27900411575087e+017 j:1.17927964021785e+017 k:-1.80978764473085e+017 and then subtract this vector from the vectors for all of the systems. Or you could invert all of the coordinates and add all the vectors instead. If you do this right, the desired central system will end up with a zero vector and be the point of origin.

bdm
Posts: 461
Joined: 22.07.2005
With us: 19 years 4 months
Location: Australia

Re: Confusion on how to convert coorrdinates

Post #4by bdm » 16.08.2008, 01:42

As for converting from three-dimensional cartesian to polar coordinates, Wikipedia may be helpful: Spherical coordinates

Topic author
MEaster
Posts: 4
Joined: 19.07.2008
With us: 16 years 4 months

Re: Confusion on how to convert coorrdinates

Post #5by MEaster » 16.08.2008, 10:13

OK, I've managed to place an open cluster using the Position perameter, but I'm having trouble placing a star using it. Does the Position perameter work when placing stars? In the DSC file I have

Code: Select all

OpenCluster "New Eden"
{
      Position [ -4661.91839805 4218.64281476 -2881.78484274 ]
}


and in the STC file I have this for the star

Code: Select all

Star 65481631 "Isinokka"
{
   Position [ -4637.82879105 4206.17755286 -2862.65496364 ]
   SpectralType "K7V"
   AbsMag 6.5
}


I obviously went wrong somewhere because the star doesn't get created in Celestia.

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

Re: Confusion on how to convert coorrdinates

Post #6by selden » 16.08.2008, 11:12

Unfortunately, Celestia is not as consistent as perhaps it should be.
The keyword Position doesn't work in STC files.

Also, although RA, Dec and Distance work in both DSC and STC files, RA in DSC files must be specified in fractional hours while RA in STC files must be specified in fractional degrees. (1 hour = 15 degrees)
Selden

Topic author
MEaster
Posts: 4
Joined: 19.07.2008
With us: 16 years 4 months

Re: Confusion on how to convert coorrdinates

Post #7by MEaster » 16.08.2008, 16:39

Guys, thanks for the help, I got it working! :D So far, I've got a PHP script(shush, it's the only way I know to access a database) to generate the files necessary to create a barycentre for a region, all the constellations in it, and then create a star in the correct place.

Got a pic of The Forge at http://img50.imageshack.us/my.php?image ... rgefi8.jpg

Next task will be to create the planets and moons in each system.

[edit] OK having trouble with planets, and can't figure out what's wrong. The file tree is as follows:

Code: Select all

extras
     New Eden
          The Forge
               Onirvura
                    Onivura.stc - Contains the stars in the Onivura constellation
                    Josameto.ssc - Contains the planets and moons in the Josameto system


now, for some reason, Celestia isn't creating the planets around the stars.The code for the Josameto star is

Code: Select all

Star 30000156 "Josameto"
{
   Distance 6900.6799443487
   Dec 24.588931966512
   RA 137.85037207853
   SpectralType "K1 V"
   AbsMag 1.47
}


and the code for one of the planets around the star is

Code: Select all

"Josameto I" "Josameto"
{
   Texture "neptune.*"
   Color   [ 1 0.75 0.7 ]
   HazeColor [ 1 1 1 ]
   HazeDensity 0.3
   Radius 2066.17 # equatorial
   Oblateness 0.0649
   
   Atmosphere
   {
      Height 300
      Lower [ 0.7 0.6 0.5 ]
      Upper [ 0.5 0.45 0.4 ]
      Sky [ 0.8 0.8 0.8 ]
      Sunset [ 1 0.6 0.2 ]
   }

   EllipticalOrbit
   {
      Period 0.20388137108947
      SemiMajorAxis 0.34640570061097
      Eccentricity 0.0223253
      Inclination 137.83488325674
   {
   
   UniformRotation
   {
      Period 8434.1111111111
      inclination 19.73
      AscendingNode       161.6
      MeridianAngle       262.1
   }

   Albedo              0.51
}


the rest of the planets are pretty much the same, as are the moons, yet they're not being created. As for as I can tell, the planet code is correct. Any ideas?

bdm
Posts: 461
Joined: 22.07.2005
With us: 19 years 4 months
Location: Australia

Re: Confusion on how to convert coorrdinates

Post #8by bdm » 18.08.2008, 23:35

Celestia loads files in alphabetical order. I've never experimented with the creation of fictional stars, but I suspect that you will need to try this for each system:

Jel.ssc
Jel.stc
Ney.ssc
Ney.stc

There is also no need to follow Eve's Region-Constellation-System hierarchy precisely. Celestia won't tell you which directory a particular star was loaded from. The Eve hierarchy is intended as a way of seamlessly distributing the systems among the various Eve servers. You may find it useful to go to a flatter tree, such as Region-System, Constellation-System, or even simply System (a single directory containing all the files). IIRC no two systems in Eve have exactly the same name so this should be possible.

Topic author
MEaster
Posts: 4
Joined: 19.07.2008
With us: 16 years 4 months

Re: Confusion on how to convert coorrdinates

Post #9by MEaster » 19.08.2008, 15:00

Heh, I found what the problem was, the ElipticalOrbit paremeter group has 2 open brackets, not an open/close. It works perfectly fine now. :roll:

Bdm, I know I didn't have to have this folder structure, but it does make finding a specific system file a bit easier if you know the region and constellation it's in.

Can download the addon at http://measter.pwp.blueyonder.co.uk/eve/celestiaeve.zip, it'll extract to about 220 megs.


Return to “Celestia Users”