Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Stars  (Read 4447 times)

0 Members and 1 Guest are viewing this topic.

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Stars
« on: January 14, 2019, 10:56:17 AM »

I have data for real stars, but it is incomplete

I think I have the position calculation correct, needs checking though, but I don't have any colour information.

The data I have is of the form...

Code: [Select]
       String[] star_data = new string[]
       {
     "Sirius,1.767793,-0.291751,-1.46",
     "Canopus,1.675305,-0.919716,-0.72",
    "Arcturus,3.733528,0.334798,-0.04",
    "Cen Alpha1,3.837972,-1.061776,-0.01",
 

So all I have is ...

Code: [Select]
public class Star
    {
        public String Name;
        public double RightAscension;
        public double Declination;
        public double Magnitude;

    }

What i need is colour.

Anyone available to help?


Logged

Pursuivant

  • member
  • Offline Offline
  • Posts: 711
Re: Stars
« Reply #1 on: January 15, 2019, 09:26:55 PM »

Could you work with just a spectral frequency?

If so, it's possible that the data found here would work:

https://www.eso.org/sci/facilities/paranal/decommissioned/isaac/tools/lib.html

I'm still hunting for a nice, convenient table for stellar frequencies for the stars visible to the naked eye from Earth.
Logged

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #2 on: January 16, 2019, 01:52:04 AM »

It's an interesting find, but I don't see an easy way to go from that to a colour.

I suppose if I sampled the spectra in three bands and converted that to a colour it may be useful, but I am still missing a mapping from star -> spectra

Cheers for looking though
Logged

slibenli

  • member
  • Offline Offline
  • Posts: 618
    • IL-2 Graphics Extender
Re: Stars
« Reply #3 on: January 16, 2019, 11:41:24 AM »

IIRC Celestia (https://celestia.space/) has colored stars.
Their data should come from publicly available sources.

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #4 on: January 16, 2019, 03:16:20 PM »

Found the Yale Bright Star Catalog http://tdc-www.harvard.edu/catalogs/bsc5.html

The data is in a totally stupid format, but I have written a parser and it has all I need.



It has the magnitude, ascension and declination as well as a colour code which I have decoded.

There are some 9100 stars which is about right.




Logged

slibenli

  • member
  • Offline Offline
  • Posts: 618
    • IL-2 Graphics Extender
Re: Stars
« Reply #5 on: January 16, 2019, 05:41:00 PM »

Do you you render the stars in realtime or create a sky texture from the data?

Pursuivant

  • member
  • Offline Offline
  • Posts: 711
Re: Stars
« Reply #6 on: January 17, 2019, 01:01:38 AM »

Found the Yale Bright Star Catalog

Feh. ;p

That's one of the first links I found but after messing around with it I gave up. I couldn't find a good way to extract the data and I figured it would be more trouble than it's worth, so I didn't pass the link along.

That'll teach me to underestimate your coding skills!
Logged

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #7 on: January 17, 2019, 01:48:24 AM »

Do you you render the stars in realtime or create a sky texture from the data?

I do them real time but using a very efficient system.

I basically create a batch of quads with a single texture that are positioned in 3D but displayed in 2D. The whole lot get rendered in a single draw call.

It's the equivalent of the old point sprite we used to have built into OpenGL and D3D.

I think the OpenGL API still supports them, which would make it easier. You would just need to set point size per star.
Logged

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #8 on: January 18, 2019, 02:07:58 PM »

That worked. I was going to do a video, but by the time youtube had processed the video... it was a black screen. :(

Just tested it again, and spotted the big dipper and a couple of others  :)
Logged

Pursuivant

  • member
  • Offline Offline
  • Posts: 711
Re: Stars
« Reply #9 on: January 18, 2019, 06:10:08 PM »

Will the stars, etc. be static, or will they shift position based on latitude and season?

If the latter, that will allow celestial navigation assuming that equipment for dead reckoning, etc. is eventually added to the game.
Logged

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #10 on: January 19, 2019, 03:59:18 AM »

I calculate the stars position based on latitude, longitude, date, and time.

So they will actually move realistically during a mission.

I calculate the local sidereal time every frame. The sidereal time is measured by the rotation of the Earth, with respect to the stars (rather than relative to the Sun).

Logged

Stainless

  • moderator
  • member
  • Offline Offline
  • Posts: 1531
Re: Stars
« Reply #11 on: January 19, 2019, 06:27:21 AM »

Not happy.

I think the stars look too dark.



So I wrote some extra code to scan the apparent visual magnitude, and it is weird.





I expected the data to range from -4 to about 8 but the range is 0.46 to about 8... WTF.

Is the data missing the main bright stars? Or is it using a different magnitude scale......

Logged
Pages: [1] 2   Go Up
 

Page created in 0.086 seconds with 24 queries.